summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2013-03-15 16:40:36 +0100
committerRobin Appelman <icewind@owncloud.com>2013-03-15 16:40:36 +0100
commit319e3f162cab32a2bf373b79d401569ca595f168 (patch)
treeb69982a7b083756c68bb2c3e0f10b8afebe1d245 /lib
parent32b8fd8fb7a0deb1461820e6dcfdb6a0114ff980 (diff)
downloadnextcloud-server-319e3f162cab32a2bf373b79d401569ca595f168.tar.gz
nextcloud-server-319e3f162cab32a2bf373b79d401569ca595f168.zip
Don't block uploads if the max upload size is unknown
Diffstat (limited to 'lib')
-rw-r--r--lib/helper.php4
1 files changed, 2 insertions, 2 deletions
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);