diff options
author | Arnaud Le Blanc <lbarnaud@php.net> | 2008-09-07 14:18:11 +0000 |
---|---|---|
committer | Arnaud Le Blanc <lbarnaud@php.net> | 2008-09-07 14:18:11 +0000 |
commit | 21482dd1e61e76e7ece6eeb555dda5d6568eb409 (patch) | |
tree | 7eb173f9b8c6e18174fe257bb07c500951a2e053 /main | |
parent | 3062692e4947b18fbfcaeff7f9df1f08d7959606 (diff) | |
download | php-git-21482dd1e61e76e7ece6eeb555dda5d6568eb409.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 a878d55c6c..715c8e967d 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 |