From: Nikita Popov Date: Thu, 18 Aug 2016 22:12:27 +0000 (+0200) Subject: Decouple DEBUG_FILE_UPLOAD from ZEND_DEBUG X-Git-Tag: php-7.1.0beta3~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=37b0dcc8e01085e5a93b0dfcf79f8e87bcb9c3fe;p=php Decouple DEBUG_FILE_UPLOAD from ZEND_DEBUG Enabling ZEND_DEBUG should not result in intrusive program behavior changes. --- diff --git a/main/rfc1867.c b/main/rfc1867.c index 6aa6b5d626..9cdaeccb79 100644 --- a/main/rfc1867.c +++ b/main/rfc1867.c @@ -40,7 +40,9 @@ # 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) { diff --git a/tests/basic/rfc1867_anonymous_upload.phpt b/tests/basic/rfc1867_anonymous_upload.phpt index ce1f4479ce..361bbbcca7 100644 --- a/tests/basic/rfc1867_anonymous_upload.phpt +++ b/tests/basic/rfc1867_anonymous_upload.phpt @@ -2,8 +2,6 @@ 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-- diff --git a/tests/basic/rfc1867_array_upload.phpt b/tests/basic/rfc1867_array_upload.phpt index d9f93530c2..bbaa5c82ef 100644 --- a/tests/basic/rfc1867_array_upload.phpt +++ b/tests/basic/rfc1867_array_upload.phpt @@ -2,8 +2,6 @@ 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-- diff --git a/tests/basic/rfc1867_boundary_1.phpt b/tests/basic/rfc1867_boundary_1.phpt index fe0a9f2f4d..e5321201a5 100644 --- a/tests/basic/rfc1867_boundary_1.phpt +++ b/tests/basic/rfc1867_boundary_1.phpt @@ -2,8 +2,6 @@ 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 diff --git a/tests/basic/rfc1867_boundary_2.phpt b/tests/basic/rfc1867_boundary_2.phpt index 256ec4bf78..88f213fffa 100644 --- a/tests/basic/rfc1867_boundary_2.phpt +++ b/tests/basic/rfc1867_boundary_2.phpt @@ -2,8 +2,6 @@ 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 diff --git a/tests/basic/rfc1867_empty_upload.phpt b/tests/basic/rfc1867_empty_upload.phpt index c2dcb9b2ef..039d994c50 100644 --- a/tests/basic/rfc1867_empty_upload.phpt +++ b/tests/basic/rfc1867_empty_upload.phpt @@ -2,8 +2,6 @@ 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-- diff --git a/tests/basic/rfc1867_file_upload_disabled.phpt b/tests/basic/rfc1867_file_upload_disabled.phpt index 99dee9b835..aa4b5ee0f1 100644 --- a/tests/basic/rfc1867_file_upload_disabled.phpt +++ b/tests/basic/rfc1867_file_upload_disabled.phpt @@ -2,8 +2,6 @@ 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 diff --git a/tests/basic/rfc1867_garbled_mime_headers.phpt b/tests/basic/rfc1867_garbled_mime_headers.phpt index 4010f22ca1..a6c0425335 100644 --- a/tests/basic/rfc1867_garbled_mime_headers.phpt +++ b/tests/basic/rfc1867_garbled_mime_headers.phpt @@ -2,8 +2,6 @@ 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 diff --git a/tests/basic/rfc1867_invalid_boundary.phpt b/tests/basic/rfc1867_invalid_boundary.phpt index cb27675a01..3b63b27222 100644 --- a/tests/basic/rfc1867_invalid_boundary.phpt +++ b/tests/basic/rfc1867_invalid_boundary.phpt @@ -2,8 +2,6 @@ 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 diff --git a/tests/basic/rfc1867_malicious_input.phpt b/tests/basic/rfc1867_malicious_input.phpt index 40b43d277f..98ed47ca20 100644 --- a/tests/basic/rfc1867_malicious_input.phpt +++ b/tests/basic/rfc1867_malicious_input.phpt @@ -2,8 +2,6 @@ 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 diff --git a/tests/basic/rfc1867_max_file_size.phpt b/tests/basic/rfc1867_max_file_size.phpt index 9c576b477c..1b7b9aabee 100644 --- a/tests/basic/rfc1867_max_file_size.phpt +++ b/tests/basic/rfc1867_max_file_size.phpt @@ -2,8 +2,6 @@ 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-- diff --git a/tests/basic/rfc1867_max_file_uploads_empty_files.phpt b/tests/basic/rfc1867_max_file_uploads_empty_files.phpt index 76327fdb06..4da55f2597 100644 --- a/tests/basic/rfc1867_max_file_uploads_empty_files.phpt +++ b/tests/basic/rfc1867_max_file_uploads_empty_files.phpt @@ -1,10 +1,7 @@ --TEST-- -rfc1867 max_file_uploads - empty files shouldn't count (non-debug version) ---SKIPIF-- - +rfc1867 max_file_uploads - empty files shouldn't count --INI-- file_uploads=1 -error_reporting=E_ALL max_file_uploads=2 --POST_RAW-- Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737 diff --git a/tests/basic/rfc1867_max_file_uploads_empty_files_debug.phpt b/tests/basic/rfc1867_max_file_uploads_empty_files_debug.phpt deleted file mode 100644 index 279851cc28..0000000000 --- a/tests/basic/rfc1867_max_file_uploads_empty_files_debug.phpt +++ /dev/null @@ -1,102 +0,0 @@ ---TEST-- -rfc1867 max_file_uploads - empty files shouldn't count (debug version) ---SKIPIF-- - ---INI-- -file_uploads=1 -error_reporting=E_ALL -max_file_uploads=1 ---POST_RAW-- -Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737 ------------------------------20896060251896012921717172737 -Content-Disposition: form-data; name="file2"; filename="" -Content-Type: text/plain-file - - ------------------------------20896060251896012921717172737 -Content-Disposition: form-data; name="file3"; filename="" -Content-Type: text/plain-file - -33 ------------------------------20896060251896012921717172737 -Content-Disposition: form-data; name="file4"; filename="file4.txt" -Content-Type: text/plain-file - - ------------------------------20896060251896012921717172737 -Content-Disposition: form-data; name="file1"; filename="file1.txt" -Content-Type: text/plain-file - -1 ------------------------------20896060251896012921717172737-- ---FILE-- - ---EXPECTF-- -Notice: No file uploaded in Unknown on line 0 - -Notice: No file uploaded in Unknown on line 0 - -Warning: Uploaded file size 0 - file [file4=file4.txt] not saved in Unknown on line 0 -array(4) { - ["file2"]=> - array(5) { - ["name"]=> - string(0) "" - ["type"]=> - string(0) "" - ["tmp_name"]=> - string(0) "" - ["error"]=> - int(4) - ["size"]=> - int(0) - } - ["file3"]=> - array(5) { - ["name"]=> - string(0) "" - ["type"]=> - string(0) "" - ["tmp_name"]=> - string(0) "" - ["error"]=> - int(4) - ["size"]=> - int(0) - } - ["file4"]=> - array(5) { - ["name"]=> - string(9) "file4.txt" - ["type"]=> - string(0) "" - ["tmp_name"]=> - string(0) "" - ["error"]=> - int(5) - ["size"]=> - int(0) - } - ["file1"]=> - array(5) { - ["name"]=> - string(9) "file1.txt" - ["type"]=> - string(15) "text/plain-file" - ["tmp_name"]=> - string(%d) "%s" - ["error"]=> - int(0) - ["size"]=> - int(1) - } -} -array(0) { -} -string(1) "1" diff --git a/tests/basic/rfc1867_missing_boundary.phpt b/tests/basic/rfc1867_missing_boundary.phpt index 6218b135f1..aadd1a8aed 100644 --- a/tests/basic/rfc1867_missing_boundary.phpt +++ b/tests/basic/rfc1867_missing_boundary.phpt @@ -2,8 +2,6 @@ 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 diff --git a/tests/basic/rfc1867_missing_boundary_2.phpt b/tests/basic/rfc1867_missing_boundary_2.phpt index a8f38ae533..1c4581c6c3 100644 --- a/tests/basic/rfc1867_missing_boundary_2.phpt +++ b/tests/basic/rfc1867_missing_boundary_2.phpt @@ -2,8 +2,6 @@ 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 diff --git a/tests/basic/rfc1867_post_max_filesize.phpt b/tests/basic/rfc1867_post_max_filesize.phpt index 04c0c5c2b9..da851c417c 100644 --- a/tests/basic/rfc1867_post_max_filesize.phpt +++ b/tests/basic/rfc1867_post_max_filesize.phpt @@ -2,8 +2,6 @@ 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-- diff --git a/tests/basic/rfc1867_post_max_size.phpt b/tests/basic/rfc1867_post_max_size.phpt index 92281351df..eba547c7d9 100644 --- a/tests/basic/rfc1867_post_max_size.phpt +++ b/tests/basic/rfc1867_post_max_size.phpt @@ -2,8 +2,6 @@ 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