Details
-
Bug
-
Resolution: Fixed
-
Medium
-
4.1.3
-
None
Description
Hi
The ezbinaryfile has support for detecting if file is bigger than upload_max_file_size. However, ezbinaryfile doesn't detect if file size exceeds post_max_size.
This is not possible to detect by a datatype either since all post variables are removed in such case. It therefore needs to be detected elsewhere (like in content/edit)
Here is a patch which does the trick.
Regarding my comment:
if( ( (int) $_SERVER['CONTENT_LENGTH'] > $postMaxSize ) && // This is not 100% accurate as $_SERVER['CONTENT_LENGTH'] doesn't only count post data but also other things
In PHP's source code you have this (main/rfc1867.c):
if (SG(request_info).content_length > SG(post_max_size)) { sapi_module.sapi_error(E_WARNING, "POST Content-Length of %ld bytes exceeds the limit of %ld bytes", SG(request_info).content_length, SG(post_max_size)); return; }
I guess SG(request_info).content_length is the size of the whole request, not only the post data. But I am not sure...Anyway, since we also check if we indeed has no POST variables I think the detection in my patch is quite OK.
Attachments
Issue Links
- relates to
-
EZP-15376 ezmultiupload doesn't handle upload_max_filesize and post_max_size limitations
- Confirmed