From:             olaf at 7val dot com
Operating system: Linux
PHP version:      5.1.2
PHP Bug Type:     Variables related
Bug description:  $_FILES Array broken with Array like input names

Description:
------------
When using input elements with names like  "file[a][b][c]" the $_FILES
Array is broken.

With more than one input element it get even worse!

Reproduce code:
---------------
<html><head>
<title>Test</title>
</head>
<body>
<pre>
<?PHP 
print_r($_FILES);
?>
</pre>
<form name="form1" enctype="multipart/form-data" method="post" ><input
name="file[a][b][c]" size="25" accept="*/*" type="file">
<input type="submit" value="OK" name="submit">
</form>
</body>
</html>

Expected result:
----------------
Array
(
    [file] => Array
           (
          [a] => Array
                        (
                                  [b] => Array 
                                     (
                                           [c] => Array 
                                             (
                                                  [name] => dsc00051.jpg
                                                  [type] => image/jpeg
                                                  [tmp_name] => /tmp/phpL3mhkD
                                                  [error] => 0
                                                  [size] => 56484
                                                 )
                                         )
                                )
        )
)


Actual result:
--------------
Array
(
    [file] => Array
        (
            [name] => Array
                (
                    [a] => Array
                        (
                            [b] => Array
                                (
                                    [c] => dsc00051.jpg
                                )

                        )

                )

            [type] => Array
                (
                    [a] => Array
                        (
                            [b] => Array
                                (
                                    [c] => image/jpeg
                                )

                        )

                )

            [tmp_name] => Array
                (
                    [a] => Array
                        (
                            [b] => Array
                                (
                                    [c] => /tmp/php2W1O7R
                                )

                        )

                )

            [error] => Array
                (
                    [a] => Array
                        (
                            [b] => Array
                                (
                                    [c] => 0
                                )

                        )

                )

            [size] => Array
                (
                    [a] => Array
                        (
                            [b] => Array
                                (
                                    [c] => 56484
                                )

                        )

                )

        )

)

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

Reply via email to