Commit 88881404 authored by Ruslan Kabalin's avatar Ruslan Kabalin
Browse files

Consider that post_max_size is the whole POST content (bug #634829)

Reducing it by 4K should be enough not to hit PHP Warning when uploaded file
size is equial to post_max_size set in the config.
Signed-off-by: default avatarRuslan Kabalin <>
parent 2b6daab1
......@@ -2109,7 +2109,7 @@ function get_real_size($size=0) {
function get_max_upload_size($is_user) {
global $USER;
$maxuploadsize = min(get_real_size(ini_get('post_max_size')), get_real_size(ini_get('upload_max_filesize')));
$maxuploadsize = min(get_real_size(ini_get('post_max_size')) - 4096, get_real_size(ini_get('upload_max_filesize')));
if ($is_user) {
$userquotaremaining = $USER->get('quota') - $USER->get('quotaused');
$maxuploadsize = min($maxuploadsize, $userquotaremaining);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment