summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main/rfc1867.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/main/rfc1867.c b/main/rfc1867.c
index 97f7399598..780e25c379 100644
--- a/main/rfc1867.c
+++ b/main/rfc1867.c
@@ -591,12 +591,6 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler)
FILE *fp;
zend_llist header;
-
- if (!PG(file_uploads)) {
- sapi_module.sapi_error(E_WARNING, "File uploads are disabled");
- return;
- }
-
if (SG(request_info).content_length > SG(post_max_size)) {
sapi_module.sapi_error(E_WARNING, "POST Content-Length of %d bytes exceeds the limit of %d bytes", SG(request_info).content_length, SG(post_max_size));
return;
@@ -707,6 +701,13 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler)
continue;
}
+ /* If file_uploads=off, skip the file part */
+ if (!PG(file_uploads)) {
+ efree(filename);
+ efree(param);
+ continue;
+ }
+
/* Handle file */
fp = php_open_temporary_file(PG(upload_tmp_dir), "php", &temp_filename TSRMLS_CC);
if (!fp) {