From 785c49533cd684def44c4c484df1d4c1f74af2f6 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Thu, 24 Mar 2016 11:51:28 +0100 Subject: 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) --- lib/private/files/storage/dav.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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; } -- cgit v1.2.3