diff options
author | Arnaud Le Blanc <lbarnaud@php.net> | 2008-09-07 14:17:47 +0000 |
---|---|---|
committer | Arnaud Le Blanc <lbarnaud@php.net> | 2008-09-07 14:17:47 +0000 |
commit | ef38ff62a5eca7a70c70df66d6b65edc2bf58fa5 (patch) | |
tree | 5854b081d97335f1949cc75bda490d2572ef980b /main | |
parent | dd956381e21db9e4885e20d140d489294c3301cc (diff) | |
download | php-git-ef38ff62a5eca7a70c70df66d6b65edc2bf58fa5.tar.gz |
MFH: More accurate max_file_size / upload_max_filesize (fixes #45124)
Diffstat (limited to 'main')
-rw-r--r-- | main/rfc1867.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/main/rfc1867.c b/main/rfc1867.c index 16317aa351..af58ba4b75 100644 --- a/main/rfc1867.c +++ b/main/rfc1867.c @@ -1077,12 +1077,12 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) } - if (PG(upload_max_filesize) > 0 && total_bytes > PG(upload_max_filesize)) { + if (PG(upload_max_filesize) > 0 && (total_bytes+blen) > PG(upload_max_filesize)) { #if 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)) { + } else if (max_file_size && ((total_bytes+blen) > max_file_size)) { #if 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 |