diff options
author | Vincent Petry <pvince81@owncloud.com> | 2014-03-20 15:29:14 +0100 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2014-03-20 15:29:14 +0100 |
commit | 316a22b46315a389e38cd9f1e320f3e1f0541d68 (patch) | |
tree | da7e385a0cf9b43b56446cb54cfdcec615a71b8b /lib | |
parent | 5747e0e3f98d3c299b0bd46bb77ca7bf6b170312 (diff) | |
parent | 66bc0f0848846bce3680b79da4209d42620f1b8d (diff) | |
download | nextcloud-server-316a22b46315a389e38cd9f1e320f3e1f0541d68.tar.gz nextcloud-server-316a22b46315a389e38cd9f1e320f3e1f0541d68.zip |
Merge pull request #7808 from owncloud/quota-usequotaevenwhenfreespaceunknown
Still return quota value when free space is unknown
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/files/storage/wrapper/quota.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/private/files/storage/wrapper/quota.php b/lib/private/files/storage/wrapper/quota.php index 32ceba8b196..a878b2c5cf6 100644 --- a/lib/private/files/storage/wrapper/quota.php +++ b/lib/private/files/storage/wrapper/quota.php @@ -69,7 +69,14 @@ class Quota extends Wrapper { return \OC\Files\SPACE_NOT_COMPUTED; } else { $free = $this->storage->free_space($path); - return min($free, (max($this->quota - $used, 0))); + $quotaFree = max($this->quota - $used, 0); + // if free space is known + if ($free >= 0) { + $free = min($free, $quotaFree); + } else { + $free = $quotaFree; + } + return $free; } } } |