You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

65 lines
1.6 KiB

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