From: bugs at nikmakepeace dot com Operating system: Fedora Core 3 PHP version: 5.1.2 PHP Bug Type: Variables related Bug description: $_FILES array keys have periods replaced with underscores
Description: ------------ After a file upload, the $_FILES array does not faithfully reflect the structure of the form from which the upload was made. An input with the valid HTML name of 'a.b' becomes the key 'a_b' in the $_FILES array. The same is true of the other request superglobals. The PHP manual says that an array index can be any string, and the HTML 5 rec says that the name attribute can be CDATA. Now that register_globals is on its last legs in the community, could you make it so that the dot transformation happens only when you explictly extract() or import_request_variables() Reproduce code: --------------- <form enctype="multipart/form-data" method="POST"> <input name="a.b" type="file" /> <input type="submit" /> </form> Expected result: ---------------- Something like this: $_FILES is array ( 'a.b' => array ( 'name' => '5364-16.jpg', 'type' => 'image/jpeg', 'tmp_name' => '/tmp/php7vvvc0', 'error' => 0, 'size' => 66554, ), ) Actual result: -------------- $_FILES is array ( 'a_b' => array ( 'name' => '5364-16.jpg', 'type' => 'image/jpeg', 'tmp_name' => '/tmp/php7vvvc0', 'error' => 0, 'size' => 66554, ), ) -- Edit bug report at http://bugs.php.net/?id=36171&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=36171&r=trysnapshot44 Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=36171&r=trysnapshot51 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=36171&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=36171&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=36171&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=36171&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=36171&r=needscript Try newer version: http://bugs.php.net/fix.php?id=36171&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=36171&r=support Expected behavior: http://bugs.php.net/fix.php?id=36171&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=36171&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=36171&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=36171&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=36171&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=36171&r=dst IIS Stability: http://bugs.php.net/fix.php?id=36171&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=36171&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=36171&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=36171&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=36171&r=mysqlcfg