summaryrefslogtreecommitdiff
path: root/main/rfc1867.c
diff options
context:
space:
mode:
authorDerick Rethans <derick@php.net>2004-03-25 21:27:23 +0000
committerDerick Rethans <derick@php.net>2004-03-25 21:27:23 +0000
commitfe576c7acb71763b63a8bd289a0c56d7da2f290a (patch)
tree19eb7d9a9cdef9bcdb5e424a1269a000cc53991d /main/rfc1867.c
parentb2ac395957d6dbd4b7e7654daf391e927f9a43f1 (diff)
downloadphp-git-fe576c7acb71763b63a8bd289a0c56d7da2f290a.tar.gz
- Stopped file uploads from throwing E_WARNINGs and E_NOTICEs which can not be
hidden from within scripts (and a result value in the $_FILES global can be used to see the real failure anyway).
Diffstat (limited to 'main/rfc1867.c')
-rw-r--r--main/rfc1867.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/main/rfc1867.c b/main/rfc1867.c
index 3988a9f330..e133769a69 100644
--- a/main/rfc1867.c
+++ b/main/rfc1867.c
@@ -33,7 +33,7 @@
#include "php_variables.h"
#include "rfc1867.h"
-#undef DEBUG_FILE_UPLOAD
+#define DEBUG_FILE_UPLOAD ZEND_DEBUG
#if HAVE_MBSTRING && !defined(COMPILE_DL_MBSTRING)
#include "ext/mbstring/mbstring.h"
@@ -957,16 +957,22 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler)
while (!cancel_upload && (blen = multipart_buffer_read(mbuff, buff, sizeof(buff) TSRMLS_CC)))
{
if (PG(upload_max_filesize) > 0 && total_bytes > PG(upload_max_filesize)) {
- sapi_module.sapi_error(E_WARNING, "upload_max_filesize of %ld bytes exceeded - file [%s=%s] not saved", PG(upload_max_filesize), param, filename);
+#ifdef DEBUG_FILE_UPLOAD
+ sapi_module.sapi_error(E_NOTICE, "upload_max_filesize of %ld bytes exceeded - file [%s=%s] not saved", PG(upload_max_filesize), param, filename);
+#endif
cancel_upload = UPLOAD_ERROR_A;
} else if (max_file_size && (total_bytes > max_file_size)) {
- sapi_module.sapi_error(E_WARNING, "MAX_FILE_SIZE of %ld bytes exceeded - file [%s=%s] not saved", max_file_size, param, filename);
+#ifdef DEBUG_FILE_UPLOAD
+ sapi_module.sapi_error(E_NOTICE, "MAX_FILE_SIZE of %ld bytes exceeded - file [%s=%s] not saved", max_file_size, param, filename);
+#endif
cancel_upload = UPLOAD_ERROR_B;
} else if (blen > 0) {
wlen = fwrite(buff, 1, blen, fp);
if (wlen < blen) {
- sapi_module.sapi_error(E_WARNING, "Only %d bytes were written, expected to write %ld", wlen, blen);
+#ifdef DEBUG_FILE_UPLOAD
+ sapi_module.sapi_error(E_NOTICE, "Only %d bytes were written, expected to write %ld", wlen, blen);
+#endif
cancel_upload = UPLOAD_ERROR_C;
} else {
total_bytes += wlen;