]> granicus.if.org Git - php/commitdiff
Fixed a bug with file_uploads=off -> normal post variables not set.
authorfoobar <sniper@php.net>
Sat, 30 Mar 2002 02:58:19 +0000 (02:58 +0000)
committerfoobar <sniper@php.net>
Sat, 30 Mar 2002 02:58:19 +0000 (02:58 +0000)
main/rfc1867.c

index 97f739959808758afcbe337ce909eace771606e9..780e25c37939188edd5417ead735f4fa84cf996c 100644 (file)
@@ -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) {