diff options
author | Vincent Petry <pvince81@owncloud.com> | 2016-03-24 11:51:28 +0100 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2016-03-24 14:11:06 +0100 |
commit | 7c86d79374f46b5434bd06f8a411f74ff11b8977 (patch) | |
tree | 616e1f88115b58a56977a309a693464cfeb072e9 | |
parent | 3b3780f5322c84bb280a41bc90c16ee4420ee8b3 (diff) | |
download | nextcloud-server-7c86d79374f46b5434bd06f8a411f74ff11b8977.tar.gz nextcloud-server-7c86d79374f46b5434bd06f8a411f74ff11b8977.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.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/private/files/storage/dav.php b/lib/private/files/storage/dav.php index dcde7b8029b..c2e10cf71a7 100644 --- a/lib/private/files/storage/dav.php +++ b/lib/private/files/storage/dav.php @@ -413,7 +413,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; } |