bug55500.phpt 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. --TEST--
  2. Bug #55500 (Corrupted $_FILES indices lead to security concern)
  3. --INI--
  4. file_uploads=1
  5. error_reporting=E_ALL&~E_NOTICE
  6. upload_max_filesize=1024
  7. max_file_uploads=10
  8. --POST_RAW--
  9. Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737
  10. -----------------------------20896060251896012921717172737
  11. Content-Disposition: form-data; name="file[]"; filename="file1.txt"
  12. Content-Type: text/plain-file1
  13. 1
  14. -----------------------------20896060251896012921717172737
  15. Content-Disposition: form-data; name="file[[type]"; filename="file2.txt"
  16. Content-Type: text/plain-file2
  17. 2
  18. -----------------------------20896060251896012921717172737
  19. Content-Disposition: form-data; name="file[[name]"; filename="file3.txt"
  20. Content-Type: text/plain-file3
  21. 3
  22. -----------------------------20896060251896012921717172737
  23. Content-Disposition: form-data; name="file[name]["; filename="file4.txt"
  24. Content-Type: text/plain-file3
  25. 4
  26. -----------------------------20896060251896012921717172737--
  27. --FILE--
  28. <?php
  29. var_dump($_FILES);
  30. var_dump($_POST);
  31. ?>
  32. --EXPECTF--
  33. array(1) {
  34. ["file"]=>
  35. array(5) {
  36. ["name"]=>
  37. array(1) {
  38. [0]=>
  39. string(9) "file1.txt"
  40. }
  41. ["type"]=>
  42. array(1) {
  43. [0]=>
  44. string(16) "text/plain-file1"
  45. }
  46. ["tmp_name"]=>
  47. array(1) {
  48. [0]=>
  49. string(%d) "%s"
  50. }
  51. ["error"]=>
  52. array(1) {
  53. [0]=>
  54. int(0)
  55. }
  56. ["size"]=>
  57. array(1) {
  58. [0]=>
  59. int(1)
  60. }
  61. }
  62. }
  63. array(0) {
  64. }