Doc #79071 [NEW]: Undocumented truncation of tempnam() second parameter
From: fabienung at hotmail dot fr
Operating system: Linux
PHP version: 7.4.1
Package: Filesystem function related
Bug Type: Documentation Problem
Bug description:Undocumented truncation of tempnam() second parameter
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 bug report at https://bugs.php.net/bug.php?id=79071&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=79071&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=79071&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=79071&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=79071&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=79071&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=79071&r=support
Expected behavior: https://bugs.php.net/fix.php?id=79071&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=79071&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=79071&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=79071&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=79071&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=79071&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=79071&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=79071&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=79071&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=79071&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=79071&r=mysqlcfg
Thread (3 messages)
- fabienung at hotmail dot fr