1--TEST-- 2Bug #46313 (Magic quotes broke $_FILES) 3--SKIPIF-- 4<?php if(substr(PHP_OS, 0, 3) == "WIN") die("skip non-Windows test"); ?> 5--INI-- 6magic_quotes_gpc=1 7file_uploads=1 8register_globals=1 9display_errors=0 10--POST_RAW-- 11Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737 12-----------------------------20896060251896012921717172737 13Content-Disposition: form-data; name="o1'file"; filename="o1'file.png" 14Content-Type: text/plain-file1 15 161 17-----------------------------20896060251896012921717172737 18Content-Disposition: form-data; name="o2'file"; filename="o2'file2.txt" 19Content-Type: text/plain-file2 20 212 22-----------------------------20896060251896012921717172737-- 23--FILE-- 24<?php 25var_dump($_FILES); 26var_dump($GLOBALS["o1\'file_name"]); 27var_dump($GLOBALS["o1\'file_name"] === $_FILES["o1\'file"]["name"]); 28var_dump($GLOBALS["o1\'file"]); 29var_dump($GLOBALS["o1\'file"] === $_FILES["o1\'file"]["tmp_name"]); 30?> 31--EXPECTF-- 32array(2) { 33 ["o1\'file"]=> 34 array(5) { 35 ["name"]=> 36 string(12) "o1\'file.png" 37 ["type"]=> 38 string(16) "text/plain-file1" 39 ["tmp_name"]=> 40 string(%d) "%s" 41 ["error"]=> 42 int(0) 43 ["size"]=> 44 int(1) 45 } 46 ["o2\'file"]=> 47 array(5) { 48 ["name"]=> 49 string(13) "o2\'file2.txt" 50 ["type"]=> 51 string(16) "text/plain-file2" 52 ["tmp_name"]=> 53 string(%d) "%s" 54 ["error"]=> 55 int(0) 56 ["size"]=> 57 int(1) 58 } 59} 60string(12) "o1\'file.png" 61bool(true) 62string(%d) "%s" 63bool(true) 64