cvs: php4(PHP_4_2_0) /main rfc1867.c
| From: | Jani Taskinen | Date: | Mon, 01 Apr 2002 23:29:20 +0000 |
| Subject: | cvs: php4(PHP_4_2_0) /main rfc1867.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-10821@lists.php.net to get a copy of this message | ||
sniper Mon Apr 1 18:29:20 2002 EDT
Modified files: (Branch: PHP_4_2_0)
/php4/main rfc1867.c
Log:
MFH
Index: php4/main/rfc1867.c
diff -u php4/main/rfc1867.c:1.94.2.1 php4/main/rfc1867.c:1.94.2.2
--- php4/main/rfc1867.c:1.94.2.1 Sun Mar 10 06:04:20 2002
+++ php4/main/rfc1867.c Mon Apr 1 18:29:19 2002
@@ -16,7 +16,7 @@
| Jani Taskinen <sniper@php.net> |
+----------------------------------------------------------------------+
*/
-/* $Id: rfc1867.c,v 1.94.2.1 2002/03/10 11:04:20 sesser Exp $ */
+/* $Id: rfc1867.c,v 1.94.2.2 2002/04/01 23:29:19 sniper Exp $ */
/*
* This product includes software developed by the Apache Group
@@ -591,12 +591,6 @@
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;
@@ -705,6 +699,20 @@
efree(param);
efree(value);
continue;
+ }
+
+ /* If file_uploads=off, skip the file part */
+ if (!PG(file_uploads)) {
+ efree(filename);
+ if (param) efree(param);
+ continue;
+ }
+
+ /* Return with an error if the posted data is garbled */
+ if (!param) {
+ sapi_module.sapi_error(E_WARNING, "File Upload Mime headers garbled");
+ efree(filename);
+ SAFE_RETURN;
}
/* Handle file */