From: Robin Appelman Date: Fri, 15 Mar 2013 15:40:36 +0000 (+0100) Subject: Don't block uploads if the max upload size is unknown X-Git-Tag: v6.0.0alpha2~1046^2~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=319e3f162cab32a2bf373b79d401569ca595f168;p=nextcloud-server.git Don't block uploads if the max upload size is unknown --- diff --git a/apps/files/templates/index.php b/apps/files/templates/index.php index a53df4e2d3e..0d7185bcb78 100644 --- a/apps/files/templates/index.php +++ b/apps/files/templates/index.php @@ -23,8 +23,10 @@ method="post" enctype="multipart/form-data" target="file_upload_target_1"> + = 0):?> + diff --git a/lib/helper.php b/lib/helper.php index 6ee8a489164..687f61520a5 100644 --- a/lib/helper.php +++ b/lib/helper.php @@ -764,7 +764,8 @@ class OC_Helper { public static function maxUploadFilesize($dir) { $upload_max_filesize = OCP\Util::computerFileSize(ini_get('upload_max_filesize')); $post_max_size = OCP\Util::computerFileSize(ini_get('post_max_size')); - if ($upload_max_filesize === 0 and $post_max_size === 0) { + $freeSpace = \OC\Files\Filesystem::free_space($dir); + if ($upload_max_filesize == 0 and $post_max_size == 0) { $maxUploadFilesize = \OC\Files\FREE_SPACE_UNLIMITED; } elseif ($upload_max_filesize === 0 or $post_max_size === 0) { $maxUploadFilesize = max($upload_max_filesize, $post_max_size); //only the non 0 value counts @@ -772,7 +773,6 @@ class OC_Helper { $maxUploadFilesize = min($upload_max_filesize, $post_max_size); } - $freeSpace = \OC\Files\Filesystem::free_space($dir); if($freeSpace !== \OC\Files\FREE_SPACE_UNKNOWN){ $freeSpace = max($freeSpace, 0);