Commit 69d069ce authored by webchick's avatar webchick

#619434 by jim0203, jablko: Fixed can't set 'default maximum file size per...

#619434 by jim0203, jablko: Fixed can't set 'default maximum file size per upload' when upload_max_filesize() is '0' (unlimited).
parent c220873e
......@@ -1784,9 +1784,15 @@ function file_upload_max_size() {
static $max_size = -1;
if ($max_size < 0) {
// Start with post_max_size.
$max_size = parse_size(ini_get('post_max_size'));
// If upload_max_size is less, then reduce. Except if upload_max_size is
// zero, which indicates no limit.
$upload_max = parse_size(ini_get('upload_max_filesize'));
$post_max = parse_size(ini_get('post_max_size'));
$max_size = ($upload_max < $post_max) ? $upload_max : $post_max;
if ($upload_max > 0 && $upload_max < $max_size) {
$max_size = $upload_max;
}
}
return $max_size;
}
......
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