Doc #79071 [NEW]: Undocumented truncation of tempnam() second parameter

From: Date: Mon, 06 Jan 2020 14:11:30 +0000
Subject: Doc #79071 [NEW]: Undocumented truncation of tempnam() second parameter
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-17183@lists.php.net to get a copy of this message
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)

« previous php.doc.bugs (#17183) next »