From:             php at info-svc dot com
Operating system: Linux
PHP version:      5.2.6
PHP Bug Type:     *General Issues
Bug description:  extract($_FILES) result unpredictable

Description:
------------
After receiving reports of a broken feature, the problem was traced to
extract($_FILES) producing different results on different servers.

A server running PHP 5.2.5 gave the expected result where
$variable['tmp_name'] contained the uploaded file path.  A server running
PHP 5.2.3 gave the unexpected result where $variable['tmp_name'] always
dumped as string(1) "/"

The workaround is to use $_FILES['tmp_name'] in which case both servers
gave the expected result.

I am stumped as to whether this is caused by a bug that was fixed between
versions or some configuration issue I am not aware of?

Robert Chapin
Chapin Information Services, Inc.

Reproduce code:
---------------
<form method="POST">
<input name="themefile" type="file" />
<input type="submit" />
</form>
<?php
extract($_FILES, EXTR_SKIP);
var_dump($themefile);
var_dump($themefile['tmp_name']);
?>

Expected result:
----------------
array(5) {
  ["name"]=>
  string(20) "samplefile.txt"
  ["type"]=>
  string(24) "application/octet-stream"
  ["tmp_name"]=>
  string(18) "/var/tmp/phpSJkwr0"
  ["error"]=>
  int(0)
  ["size"]=>
  int(379)
}
string(18) "/var/tmp/phpSJkwr0"

Actual result:
--------------
string(14) "/tmp/phpZOtyB7"
string(1) "/"

-- 
Edit bug report at http://bugs.php.net/?id=45283&edit=1
-- 
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=45283&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=45283&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=45283&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=45283&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=45283&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=45283&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=45283&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=45283&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=45283&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=45283&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=45283&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=45283&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=45283&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=45283&r=php4
Daylight Savings:             http://bugs.php.net/fix.php?id=45283&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=45283&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=45283&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=45283&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=45283&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=45283&r=mysqlcfg

Reply via email to