Commit 330b12ec authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Display better max upload size when post_max_size is 0 (bug #781457)



Change-Id: I708597dc20eaf4fe59493bd6d4d86f78de1370a2
Signed-off-by: default avatarRichard Mansfield <richard.mansfield@catalyst.net.nz>
parent aa17e510
......@@ -2165,7 +2165,12 @@ 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')) - 4096, get_real_size(ini_get('upload_max_filesize')));
if (!$postmaxsize = get_real_size(ini_get('post_max_size'))) {
$maxuploadsize = get_real_size(ini_get('upload_max_filesize'));
}
else {
$maxuploadsize = max(1024, min($postmaxsize - 4096, get_real_size(ini_get('upload_max_filesize'))));
}
if ($is_user) {
$userquotaremaining = $USER->get('quota') - $USER->get('quotaused');
$maxuploadsize = min($maxuploadsize, $userquotaremaining);
......
Markdown is supported
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