diff options
author | Thomas Müller <DeepDiver1975@users.noreply.github.com> | 2016-04-21 12:52:08 +0200 |
---|---|---|
committer | Thomas Müller <DeepDiver1975@users.noreply.github.com> | 2016-04-21 12:52:08 +0200 |
commit | 8c8ab45a1af80f24231865cd171cfc4d1a6ad144 (patch) | |
tree | bd8d57e4e878fb25c63c2c696d621e4bf73ae90e | |
parent | 6cfe339765da4bcd3fc86be22ee3a26b43c257d6 (diff) | |
parent | 785c49533cd684def44c4c484df1d4c1f74af2f6 (diff) | |
download | nextcloud-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.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 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; } |