# define HAVE_ATOLL 1
#endif
-#define DEBUG_FILE_UPLOAD ZEND_DEBUG
+#ifndef DEBUG_FILE_UPLOAD
+# define DEBUG_FILE_UPLOAD 0
+#endif
static int dummy_encoding_translation(void)
{
rfc1867 anonymous upload
--INI--
file_uploads=1
-error_reporting=E_ALL&~E_NOTICE
-comment=debug builds show some additional E_NOTICE errors
upload_max_filesize=1024
max_file_uploads=10
--POST_RAW--
rfc1867 array upload
--INI--
file_uploads=1
-error_reporting=E_ALL&~E_NOTICE
-comment=debug builds show some additional E_NOTICE errors
upload_max_filesize=1024
max_file_uploads=10
--POST_RAW--
rfc1867 boundary 1
--INI--
post_max_size=1024
-error_reporting=E_ALL&~E_NOTICE
-comment=debug builds show some additional E_NOTICE errors
--POST_RAW--
Content-Type: multipart/form-data; boundary="------------------------------------foobar"
--------------------------------------foobar
rfc1867 boundary 2
--INI--
post_max_size=1024
-error_reporting=E_ALL&~E_NOTICE
-comment=debug builds show some additional E_NOTICE errors
--POST_RAW--
Content-Type: multipart/form-data; boundary=------------------------------------foo, bar
--------------------------------------foo
rfc1867 empty upload
--INI--
file_uploads=1
-error_reporting=E_ALL&~E_NOTICE
-comment=debug builds show some additional E_NOTICE errors
upload_max_filesize=1024
max_file_uploads=10
--POST_RAW--
rfc1867 file_upload disabled
--INI--
file_uploads=0
-error_reporting=E_ALL&~E_NOTICE
-comment=debug builds show some additional E_NOTICE errors
--POST_RAW--
Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737
-----------------------------20896060251896012921717172737
rfc1867 garbled mime headers
--INI--
file_uploads=1
-error_reporting=E_ALL&~E_NOTICE
-comment=debug builds show some additional E_NOTICE errors
upload_max_filesize=1024
--POST_RAW--
Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737
rfc1867 invalid boundary
--INI--
post_max_size=1024
-error_reporting=E_ALL&~E_NOTICE
-comment=debug builds show some additional E_NOTICE errors
--POST_RAW--
Content-Type: multipart/form-data; boundary="foobar
-----------------------------20896060251896012921717172737
rfc1867 malicious input
--INI--
file_uploads=1
-error_reporting=E_ALL&~E_NOTICE
-comment=debug builds show some additional E_NOTICE errors
upload_max_filesize=1024
--POST_RAW--
Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737
rfc1867 MAX_FILE_SIZE
--INI--
file_uploads=1
-error_reporting=E_ALL&~E_NOTICE
-comment=debug builds show some additional E_NOTICE errors
upload_max_filesize=1024
max_file_uploads=10
--POST_RAW--
--TEST--\r
-rfc1867 max_file_uploads - empty files shouldn't count (non-debug version)\r
---SKIPIF--\r
-<?php if(function_exists("leak")) print "skip only for non-debug builds"; ?>\r
+rfc1867 max_file_uploads - empty files shouldn't count\r
--INI--\r
file_uploads=1\r
-error_reporting=E_ALL\r
max_file_uploads=2\r
--POST_RAW--\r
Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737\r
+++ /dev/null
---TEST--\r
-rfc1867 max_file_uploads - empty files shouldn't count (debug version)\r
---SKIPIF--\r
-<?php if(!function_exists("leak")) print "skip only for debug builds"; ?>\r
---INI--\r
-file_uploads=1\r
-error_reporting=E_ALL\r
-max_file_uploads=1\r
---POST_RAW--\r
-Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737\r
------------------------------20896060251896012921717172737\r
-Content-Disposition: form-data; name="file2"; filename=""\r
-Content-Type: text/plain-file\r
-\r
-\r
------------------------------20896060251896012921717172737\r
-Content-Disposition: form-data; name="file3"; filename=""\r
-Content-Type: text/plain-file\r
-\r
-33\r
------------------------------20896060251896012921717172737\r
-Content-Disposition: form-data; name="file4"; filename="file4.txt"\r
-Content-Type: text/plain-file\r
-\r
-\r
------------------------------20896060251896012921717172737\r
-Content-Disposition: form-data; name="file1"; filename="file1.txt"\r
-Content-Type: text/plain-file\r
-\r
-1\r
------------------------------20896060251896012921717172737--\r
---FILE--\r
-<?php\r
-var_dump($_FILES);\r
-var_dump($_POST);\r
-if (is_uploaded_file($_FILES["file1"]["tmp_name"])) {\r
- var_dump(file_get_contents($_FILES["file1"]["tmp_name"]));\r
-}\r
-?>\r
---EXPECTF--\r
-Notice: No file uploaded in Unknown on line 0\r
-\r
-Notice: No file uploaded in Unknown on line 0\r
-\r
-Warning: Uploaded file size 0 - file [file4=file4.txt] not saved in Unknown on line 0\r
-array(4) {\r
- ["file2"]=>\r
- array(5) {\r
- ["name"]=>\r
- string(0) ""\r
- ["type"]=>\r
- string(0) ""\r
- ["tmp_name"]=>\r
- string(0) ""\r
- ["error"]=>\r
- int(4)\r
- ["size"]=>\r
- int(0)\r
- }\r
- ["file3"]=>\r
- array(5) {\r
- ["name"]=>\r
- string(0) ""\r
- ["type"]=>\r
- string(0) ""\r
- ["tmp_name"]=>\r
- string(0) ""\r
- ["error"]=>\r
- int(4)\r
- ["size"]=>\r
- int(0)\r
- }\r
- ["file4"]=>\r
- array(5) {\r
- ["name"]=>\r
- string(9) "file4.txt"\r
- ["type"]=>\r
- string(0) ""\r
- ["tmp_name"]=>\r
- string(0) ""\r
- ["error"]=>\r
- int(5)\r
- ["size"]=>\r
- int(0)\r
- }\r
- ["file1"]=>\r
- array(5) {\r
- ["name"]=>\r
- string(9) "file1.txt"\r
- ["type"]=>\r
- string(15) "text/plain-file"\r
- ["tmp_name"]=>\r
- string(%d) "%s"\r
- ["error"]=>\r
- int(0)\r
- ["size"]=>\r
- int(1)\r
- }\r
-}\r
-array(0) {\r
-}\r
-string(1) "1"\r
rfc1867 missing boundary
--INI--
post_max_size=1024
-error_reporting=E_ALL&~E_NOTICE
-comment=debug builds show some additional E_NOTICE errors
--POST_RAW--
Content-Type: multipart/form-data
-----------------------------20896060251896012921717172737
rfc1867 missing boundary 2
--INI--
file_uploads=1
-error_reporting=E_ALL&~E_NOTICE
-comment=debug builds show some additional E_NOTICE errors
upload_max_filesize=1024
--POST_RAW--
Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737
rfc1867 post_max_filesize
--INI--
file_uploads=1
-error_reporting=E_ALL&~E_NOTICE
-comment=debug builds show some additional E_NOTICE errors
upload_max_filesize=1
max_file_uploads=10
--POST_RAW--
rfc1867 post_max_size
--INI--
post_max_size=1
-error_reporting=E_ALL&~E_NOTICE
-comment=debug builds show some additional E_NOTICE errors
--POST_RAW--
Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737
-----------------------------20896060251896012921717172737