From: c dot d dot brengel at att dot net Operating system: Windows XP PHP version: 5.2.5 PHP Bug Type: Unknown/Other Function Bug description: tempnam $prefix parameter limitation
Description: ------------ It appears that when using "tempnam" the $prefix parameter only accepts 3 characters. I used tempnam(getcwd(),'ADR'.date(Y.m.d).'_') and the resulting file name ended up as "ADRBA.tmp" not the "ADR2008222_BA.tmp" that it should have given. I then tried tempnam(getcwd(), 'ADR123') and stil got only ADRXX.tmp. Not sure but would appreciate it if you could determine if this is in fact correct behavior. Reproduce code: --------------- <?php echo getcwd() . "\n\r"; chdir('tmp'); echo getcwd() . "\n\r"; $file=tempnam(getcwd(),'ADR'.date(Y.m.d).'_'); echo "$file"; ?> Expected result: ---------------- C:\Inetpub\wwwroot\ADRAL C:\Inetpub\wwwroot\ADRAL\tmp C:\WINDOWS\Temp\ADR2008222_C2.tmp Actual result: -------------- C:\Inetpub\wwwroot\ADRAL C:\Inetpub\wwwroot\ADRAL\tmp C:\WINDOWS\Temp\ADRC2.tmp -- Edit bug report at http://bugs.php.net/?id=44222&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=44222&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=44222&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=44222&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=44222&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=44222&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=44222&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=44222&r=needscript Try newer version: http://bugs.php.net/fix.php?id=44222&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=44222&r=support Expected behavior: http://bugs.php.net/fix.php?id=44222&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=44222&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=44222&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=44222&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=44222&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=44222&r=dst IIS Stability: http://bugs.php.net/fix.php?id=44222&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=44222&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=44222&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=44222&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=44222&r=mysqlcfg