summaryrefslogtreecommitdiffstats
path: root/lib/private/files/storage/wrapper
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-03-19 19:07:11 +0100
committerVincent Petry <pvince81@owncloud.com>2014-03-19 19:07:11 +0100
commit66bc0f0848846bce3680b79da4209d42620f1b8d (patch)
treea40ca59c2f0fffe79f6ca9e014eb129c2473e3d6 /lib/private/files/storage/wrapper
parent6252c248c23661beef6484cf1ffa24db406e28ae (diff)
downloadnextcloud-server-66bc0f0848846bce3680b79da4209d42620f1b8d.tar.gz
nextcloud-server-66bc0f0848846bce3680b79da4209d42620f1b8d.zip
Still return quota value when free space is unknown
Fixed the quota storage wrapper to correctly return the quota value when the free space is not known (which usually happens when the disk_free_space function is disabled)
Diffstat (limited to 'lib/private/files/storage/wrapper')
-rw-r--r--lib/private/files/storage/wrapper/quota.php9
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;
}
}
}