diff --git a/apps/dav/lib/Connector/Sabre/QuotaPlugin.php b/apps/dav/lib/Connector/Sabre/QuotaPlugin.php index 4aef5fc8a5..f0958c353a 100644 --- a/apps/dav/lib/Connector/Sabre/QuotaPlugin.php +++ b/apps/dav/lib/Connector/Sabre/QuotaPlugin.php @@ -106,7 +106,7 @@ class QuotaPlugin extends \Sabre\DAV\ServerPlugin { $uri = rtrim($parentUri, '/') . '/' . $info['name']; } $freeSpace = $this->getFreeSpace($uri); - if ($freeSpace !== FileInfo::SPACE_UNKNOWN && $length > $freeSpace) { + if ($freeSpace !== FileInfo::SPACE_UNKNOWN && $freeSpace !== FileInfo::SPACE_UNLIMITED && $length > $freeSpace) { if (isset($chunkHandler)) { $chunkHandler->cleanup(); } diff --git a/apps/dav/tests/unit/Connector/Sabre/QuotaPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/QuotaPluginTest.php index b37abdc9b0..6286362f47 100644 --- a/apps/dav/tests/unit/Connector/Sabre/QuotaPluginTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/QuotaPluginTest.php @@ -24,6 +24,7 @@ * */ namespace OCA\DAV\Tests\unit\Connector\Sabre; +use OCP\Files\FileInfo; use Test\TestCase; /** @@ -107,11 +108,16 @@ class QuotaPluginTest extends TestCase { array(1024, array('X-EXPECTED-ENTITY-LENGTH' => '1024')), array(1024, array('CONTENT-LENGTH' => '512')), array(1024, array('OC-TOTAL-LENGTH' => '1024', 'CONTENT-LENGTH' => '512')), - // \OCP\Files\FileInfo::SPACE-UNKNOWN = -2 - array(-2, array()), - array(-2, array('X-EXPECTED-ENTITY-LENGTH' => '1024')), - array(-2, array('CONTENT-LENGTH' => '512')), - array(-2, array('OC-TOTAL-LENGTH' => '1024', 'CONTENT-LENGTH' => '512')), + + array(FileInfo::SPACE_UNKNOWN, array()), + array(FileInfo::SPACE_UNKNOWN, array('X-EXPECTED-ENTITY-LENGTH' => '1024')), + array(FileInfo::SPACE_UNKNOWN, array('CONTENT-LENGTH' => '512')), + array(FileInfo::SPACE_UNKNOWN, array('OC-TOTAL-LENGTH' => '1024', 'CONTENT-LENGTH' => '512')), + + array(FileInfo::SPACE_UNLIMITED, array()), + array(FileInfo::SPACE_UNLIMITED, array('X-EXPECTED-ENTITY-LENGTH' => '1024')), + array(FileInfo::SPACE_UNLIMITED, array('CONTENT-LENGTH' => '512')), + array(FileInfo::SPACE_UNLIMITED, array('OC-TOTAL-LENGTH' => '1024', 'CONTENT-LENGTH' => '512')), ); }