PHP :: Bug #46313 :: Magic quotes broke $_FILES
| Bug #46313 | Magic quotes broke $_FILES | ||||
|---|---|---|---|---|---|
| Submitted: | 2008-10-16 11:36 UTC | Modified: | 2008-10-21 08:23 UTC | ||
| From: | david at grudl dot com | Assigned: | |||
| Status: | Closed | Package: | HTTP related | ||
| PHP Version: | 5.3.0alpha2 | OS: | windows xp | ||
| Private report: | No | CVE-ID: | None | ||
[2008-10-16 11:36 UTC] david at grudl dot com
Description: ------------ When magic_quotes_gpc are enabled, array $_FILES in weird. 1) truncated file name (see "closed" bug #29369) 2) slashes and non-slashed keys Reproduce code: --------------- <form action="" method="post" enctype="multipart/form-data"> <input type="file" name="o'file"> </form> Lets upload file named o'brazek.png (there are quotes in element name and in file name to demonstrate both errors) Expected result: ---------------- array(2) { "o\'file" => array(4) { "name" => string(11) "o'brazek.png" // or o\'brazek.png ? "type" => string(11) "image/x-png" "error" => int(0) "size" => int(20624) "tmp_name" => string(23) "C:\PHP\temp\php3ED8.tmp" } } Actual result: -------------- array(2) { "o\'file" => array(4) { "name" => string(11) "o" // name is truncated after quote "type" => string(11) "image/x-png" "error" => int(0) "size" => int(20624) } "o'file" => array(1) { // tmp_name is stored in different key "tmp_name" => string(23) "C:\PHP\temp\php3ED8.tmp" } }
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2008-10-20 18:49 UTC] lbarnaud@php.net
[2008-10-21 08:23 UTC] david at grudl dot com