diff options
author | Robin Appelman <icewind@owncloud.com> | 2013-02-16 03:27:50 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2013-02-16 03:27:50 +0100 |
commit | d96146a017bd8f7e4573e4555cea2c198fa9fbad (patch) | |
tree | eae31f519b93924a484d2e3f0e4843c95e95cb5d /lib/helper.php | |
parent | 425d41aaf93e1cd3a44ddc794414683e8e2c4648 (diff) | |
download | nextcloud-server-d96146a017bd8f7e4573e4555cea2c198fa9fbad.tar.gz nextcloud-server-d96146a017bd8f7e4573e4555cea2c198fa9fbad.zip |
Give storage backends the option to define having no known free space
When this is the case only the configured max upload size is taking into account for uploading
Diffstat (limited to 'lib/helper.php')
-rw-r--r-- | lib/helper.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/helper.php b/lib/helper.php index 0f810ffc0c2..add5c66e7be 100644 --- a/lib/helper.php +++ b/lib/helper.php @@ -762,9 +762,13 @@ class OC_Helper { $maxUploadFilesize = min($upload_max_filesize, $post_max_size); $freeSpace = \OC\Files\Filesystem::free_space($dir); - $freeSpace = max($freeSpace, 0); + if($freeSpace !== \OC\Files\FREE_SPACE_UNKNOWN){ + $freeSpace = max($freeSpace, 0); - return min($maxUploadFilesize, $freeSpace); + return min($maxUploadFilesize, $freeSpace); + } else { + return $maxUploadFilesize; + } } /** |