Doc #79071 [Ver->Csd]: Undocumented truncation of tempnam() second parameter
| From: | cmb@php.net | Date: | Sun, 09 Feb 2020 14:26:00 +0000 |
| Subject: | Doc #79071 [Ver->Csd]: Undocumented truncation of tempnam() second parameter | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-17287@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=79071&edit=1
ID: 79071
Updated by: cmb@php.net
Reported by: fabienung at hotmail dot fr
Summary: Undocumented truncation of tempnam() second
parameter
-Status: Verified
+Status: Closed
Type: Documentation Problem
Package: Filesystem function related
Operating System: Linux
PHP Version: 7.4.1
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation better.
Previous Comments:
------------------------------------------------------------------------
[2020-02-09 14:25:31] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&revision=349191
Log: Fix #79071: Undocumented truncation of tempnam() second parameter
------------------------------------------------------------------------
[2020-01-06 14:41:50] cmb@php.net
Since this truncation happens as of PHP 5.1.3, in my opinion just
documenting the fact should be sufficient.
------------------------------------------------------------------------
[2020-01-06 14:11:30] fabienung at hotmail dot fr
Description:
------------
tempnam() will truncate the second argument after 63 characters
see: https://github.com/php/php-src/blob/bbcfa66e06110d8256595e644378a5358dda3558/ext/standard/file.c#L836-L839
introduced in commit :
https://github.com/php/php-src/commit/4ca3df56d356ed8c3b55695ed588783e3f91378c
Test script:
---------------
var_dump(tempnam('/tmp',
'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbcdefghijklm'));
string(74) "/tmp/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbFkS7ld"
Expected result:
----------------
It should be documented, also maybe either do not truncate or warn if there is a truncation.
Actual result:
--------------
Silent truncation.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=79071&edit=1