diff --git a/main/inc/lib/fileUpload.lib.php b/main/inc/lib/fileUpload.lib.php index 8158011e97..26b932c8ec 100644 --- a/main/inc/lib/fileUpload.lib.php +++ b/main/inc/lib/fileUpload.lib.php @@ -411,19 +411,20 @@ function handle_uploaded_document( * * @see - enough_size() uses dir_total_space() function */ -function enough_size($file_size, $dir, $max_dir_space) { - //if dir is archive ignore +function enough_size($file_size, $dir, $max_dir_space) +{ + // If the directory is the archive directory, safely ignore the size limit if (api_get_path(SYS_ARCHIVE_PATH) == $dir) { return true; } - if ($max_dir_space) { - $already_filled_space = dir_total_space($dir); - if (($file_size + $already_filled_space) > $max_dir_space) { - return false; - } - } - return true; + if ($max_dir_space) { + $already_filled_space = dir_total_space($dir); + if (($file_size + $already_filled_space) > $max_dir_space) { + return false; + } + } + return true; }