summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Müller <DeepDiver1975@users.noreply.github.com>2016-04-21 12:52:08 +0200
committerThomas Müller <DeepDiver1975@users.noreply.github.com>2016-04-21 12:52:08 +0200
commit8c8ab45a1af80f24231865cd171cfc4d1a6ad144 (patch)
treebd8d57e4e878fb25c63c2c696d621e4bf73ae90e
parent6cfe339765da4bcd3fc86be22ee3a26b43c257d6 (diff)
parent785c49533cd684def44c4c484df1d4c1f74af2f6 (diff)
downloadnextcloud-server-8c8ab45a1af80f24231865cd171cfc4d1a6ad144.tar.gz
nextcloud-server-8c8ab45a1af80f24231865cd171cfc4d1a6ad144.zip
Merge pull request #24146 from owncloud/stable8.1-quota-recognizeremoteunlimitedquota
[stable8.1] Workaround to be able to recognize unlimited quota in fed shares
-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;
}