ID: 45283 Comment by: php at info-svc dot com Reported By: php at info-svc dot com Status: Open Bug Type: Scripting Engine problem Operating System: * PHP Version: 5.2.6 New Comment:
On the other hand, if register_globals is broken then extract($_FILES, EXTR_SKIP); is working as intended, skipping keys already registered. I can understand it's either a bug or a documentation problem, but something isn't right here. Previous Comments: ------------------------------------------------------------------------ [2008-11-05 11:15:22] [EMAIL PROTECTED] Results of extract() shouldn't depend on register_globals. ------------------------------------------------------------------------ [2008-07-02 12:26:50] [EMAIL PROTECTED] It's documentation issue. Plus you really should NOT be using register_globals=On. And using extract() on $_FILES...well..that's very flaky idea to begin with. Just don't do it. :) ------------------------------------------------------------------------ [2008-06-19 04:59:15] php at info-svc dot com I confirmed this behavior with PHP 5.2.6 running on IIS and Windows 2003 SP2. Test case output with register_globals Off array(5) { ["name"]=> string(14) "samplefile.txt" ["type"]=> string(10) "text/plain" ["tmp_name"]=> string(25) "C:\WINDOWS\Temp\php57.tmp" ["error"]=> int(0) ["size"]=> int(459) } string(25) "C:\WINDOWS\Temp\php57.tmp" Test case output with register_globals On string(25) "C:\WINDOWS\Temp\php58.tmp" string(1) "C" So I'm convinced that register_globals is involved here. There is something horribly wrong with this feature or its documentation. ------------------------------------------------------------------------ [2008-06-16 18:09:31] php at info-svc dot com Adding to the confusion, I thought perhaps the unexpected behavior could be caused by the register_globals configuration. However, according to documentation ... http://www.php.net/manual/en/faq.misc.php#faq.misc.registerglobals ... extract($_FILES, EXTR_SKIP); is the correct way to emulate register_globals On. I dumped all of the other superglobals and confirmed the only one containing a 'themefile' index was $_FILES. Both var_dump($_POST); and var_dump($_GET); returned "array(0) {}" ------------------------------------------------------------------------ [2008-06-16 17:39:59] php at info-svc dot com Note about the "Reproduce code", for best results use <form method="POST" enctype="multipart/form-data"> ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/45283 -- Edit this bug report at http://bugs.php.net/?id=45283&edit=1