]> granicus.if.org Git - php/commitdiff
Decouple DEBUG_FILE_UPLOAD from ZEND_DEBUG
authorNikita Popov <nikic@php.net>
Thu, 18 Aug 2016 22:12:27 +0000 (00:12 +0200)
committerNikita Popov <nikic@php.net>
Thu, 18 Aug 2016 22:34:13 +0000 (00:34 +0200)
Enabling ZEND_DEBUG should not result in intrusive program
behavior changes.

17 files changed:
main/rfc1867.c
tests/basic/rfc1867_anonymous_upload.phpt
tests/basic/rfc1867_array_upload.phpt
tests/basic/rfc1867_boundary_1.phpt
tests/basic/rfc1867_boundary_2.phpt
tests/basic/rfc1867_empty_upload.phpt
tests/basic/rfc1867_file_upload_disabled.phpt
tests/basic/rfc1867_garbled_mime_headers.phpt
tests/basic/rfc1867_invalid_boundary.phpt
tests/basic/rfc1867_malicious_input.phpt
tests/basic/rfc1867_max_file_size.phpt
tests/basic/rfc1867_max_file_uploads_empty_files.phpt
tests/basic/rfc1867_max_file_uploads_empty_files_debug.phpt [deleted file]
tests/basic/rfc1867_missing_boundary.phpt
tests/basic/rfc1867_missing_boundary_2.phpt
tests/basic/rfc1867_post_max_filesize.phpt
tests/basic/rfc1867_post_max_size.phpt

index 6aa6b5d626026a1695207edaa96b7531501a9eda..9cdaeccb79d2da226e0db1759ab0bc6d4498781c 100644 (file)
@@ -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)
 {
index ce1f4479ce5def5764885e905f04f64d80a445c5..361bbbcca72fcb92116dc32786181d18b3a3cb66 100644 (file)
@@ -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--
index d9f93530c2020bc3686a77c2c1b764fa07cd9161..bbaa5c82ef986ad2e85b9a462f897789b84f109c 100644 (file)
@@ -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--
index fe0a9f2f4d8173d016b52acd91881d8d6fdb0f89..e5321201a5a01c9c84270ffa92e373effd69f5ef 100644 (file)
@@ -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
index 256ec4bf78f4e15857ff0d307f4ec0a5c76a21d4..88f213fffa5914388851334ba0236d4078b6d2f6 100644 (file)
@@ -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
index c2dcb9b2ef7b392d425b9557fdfa621bb185b5c7..039d994c50b0fc8113644ae94b8bc462ebc23b15 100644 (file)
@@ -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--
index 99dee9b83504d7100c2a81a7226cb3b11d704f0c..aa4b5ee0f1d3299fdad5d0493714aaf79bffa567 100644 (file)
@@ -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
index 4010f22ca1cf8fbb59851113595ac7f7ed3a1b6f..a6c0425335f1e67afa89b82bb88ec27615d5f588 100644 (file)
@@ -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
index cb27675a0129380bd547d3936321b226e6fc788d..3b63b2722206b5155dfb3a2d51ec0ec19c91879d 100644 (file)
@@ -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
index 40b43d277f9c49154baa318792f1719f4e119b4f..98ed47ca206bbdf3ee6fe59403a4e97d5618835f 100644 (file)
@@ -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
index 9c576b477c0fec993fd94c8f34cf65231446a0ee..1b7b9aabee9758f6c3bacf51cf6f67d9459fb44c 100644 (file)
@@ -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--
index 76327fdb0650fb23dc9d032114db0f071f6fb7c8..4da55f2597bfbba1d6424368c809427183593ee3 100644 (file)
@@ -1,10 +1,7 @@
 --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
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 (file)
index 279851c..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
---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
index 6218b135f157e4c9d8a5d24a0a2d14ca1b0d325b..aadd1a8aed036c1d565c3055308cc2dfe36bcf50 100644 (file)
@@ -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
index a8f38ae5332605f139de42b156b0e656f8b599c2..1c4581c6c30088021621b9e3c1fc27c640bb03d1 100644 (file)
@@ -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
index 04c0c5c2b99eb95ab86c4d98974e50ae0b567819..da851c417c64f616c240382d4d5cd03093802115 100644 (file)
@@ -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--
index 92281351df0dd0cbd45b7f3430830ede37b89192..eba547c7d9a092fc28eb24330f15b549010c72f6 100644 (file)
@@ -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