aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2016-03-24 11:51:28 +0100
committerVincent Petry <pvince81@owncloud.com>2016-04-21 11:09:07 +0200
commit785c49533cd684def44c4c484df1d4c1f74af2f6 (patch)
treebd8d57e4e878fb25c63c2c696d621e4bf73ae90e
parent6cfe339765da4bcd3fc86be22ee3a26b43c257d6 (diff)
downloadnextcloud-server-785c49533cd684def44c4c484df1d4c1f74af2f6.tar.gz
nextcloud-server-785c49533cd684def44c4c484df1d4c1f74af2f6.zip
Workaround to be able to recognize unlimited quota in fed shares
Fixes issues where a user cannot upload to a fed share on OC >= 9.0 where the sharer has unlimited quota (-3)
-rw-r--r--lib/private/files/storage/dav.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/private/files/storage/dav.php b/lib/private/files/storage/dav.php
index 24cf3c29209..17537c2f1e1 100644
--- a/lib/private/files/storage/dav.php
+++ b/lib/private/files/storage/dav.php
@@ -423,7 +423,14 @@ class DAV extends Common {
// TODO: cacheable ?
$response = $this->client->propfind($this->encodePath($path), array('{DAV:}quota-available-bytes'));
if (isset($response['{DAV:}quota-available-bytes'])) {
- return (int)$response['{DAV:}quota-available-bytes'];
+ $freeSpace = (int)$response['{DAV:}quota-available-bytes'];
+ if ($freeSpace === FileInfo::SPACE_UNLIMITED) {
+ // most of the code cannot cope with unlimited storage,
+ // so as a workaround convert to SPACE_UNKNOWN which is a
+ // value recognized in many places
+ return FileInfo::SPACE_UNKNOWN;
+ }
+ return $freeSpace;
} else {
return FileInfo::SPACE_UNKNOWN;
}