summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZeev Suraski <zeev@php.net>2002-05-11 11:58:16 +0000
committerZeev Suraski <zeev@php.net>2002-05-11 11:58:16 +0000
commit19b7861d70a79417797a6f8ebc0d74133d75bfeb (patch)
treef869a2657050886cebc4c1bf13a16e92545006f6
parent70f72d05683cfd35e445a665473a0fd236112356 (diff)
downloadphp-git-19b7861d70a79417797a6f8ebc0d74133d75bfeb.tar.gz
0 byte file uploads are valid, avoid choking on them
-rw-r--r--main/rfc1867.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/main/rfc1867.c b/main/rfc1867.c
index 84c6078e38..6fad7eb3af 100644
--- a/main/rfc1867.c
+++ b/main/rfc1867.c
@@ -33,6 +33,8 @@
#include "rfc1867.h"
+#undef DEBUG_FILE_UPLOAD
+
#define SAFE_RETURN { \
if (lbuf) efree(lbuf); \
if (abuf) efree(abuf); \
@@ -752,19 +754,19 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler)
}
fclose(fp);
+#ifdef DEBUG_FILE_UPLOAD
if(strlen(filename) > 0 && total_bytes == 0) {
sapi_module.sapi_error(E_WARNING, "Uploaded file size 0 - file [%s=%s] not saved", param, filename);
cancel_upload = UPLOAD_ERROR_E;
}
-
- if (cancel_upload || total_bytes == 0) {
+#endif
+ if (cancel_upload) {
if (temp_filename) {
unlink(temp_filename);
efree(temp_filename);
}
temp_filename="";
-
} else {
zend_hash_add(SG(rfc1867_uploaded_files), temp_filename, strlen(temp_filename) + 1, &temp_filename, sizeof(char *), NULL);
}