summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2015-05-13 14:43:02 +0200
committerRobin Appelman <robin@icewind.nl>2015-05-13 14:43:02 +0200
commit4789e87a5378776738706b48d0db1cf1d989709a (patch)
tree6870d381631fae27cedfcc6bf18d28201aeebf2a
parent5941e826b8e6005de08fdcb777efb3def5ca8101 (diff)
parent1f7df3eba826db3310d1e0e1b15828a6801438a7 (diff)
downloadnextcloud-server-4789e87a5378776738706b48d0db1cf1d989709a.tar.gz
nextcloud-server-4789e87a5378776738706b48d0db1cf1d989709a.zip
Merge pull request #16276 from owncloud/dav-quota-root
fix webdav quota check for the root of the dav endpoint
-rw-r--r--lib/private/connector/sabre/quotaplugin.php3
-rw-r--r--tests/lib/connector/sabre/quotaplugin.php5
2 files changed, 7 insertions, 1 deletions
diff --git a/lib/private/connector/sabre/quotaplugin.php b/lib/private/connector/sabre/quotaplugin.php
index 51eab1bae6e..22b687b3508 100644
--- a/lib/private/connector/sabre/quotaplugin.php
+++ b/lib/private/connector/sabre/quotaplugin.php
@@ -89,6 +89,9 @@ class QuotaPlugin extends \Sabre\DAV\ServerPlugin {
$uri = '/' . $uri;
}
list($parentUri, $newName) = \Sabre\HTTP\URLUtil::splitPath($uri);
+ if(is_null($parentUri)) {
+ $parentUri = '';
+ }
$req = $this->server->httpRequest;
if ($req->getHeader('OC-Chunked')) {
$info = \OC_FileChunking::decodeName($newName);
diff --git a/tests/lib/connector/sabre/quotaplugin.php b/tests/lib/connector/sabre/quotaplugin.php
index 48f8f319ae4..3d9cd9b5da0 100644
--- a/tests/lib/connector/sabre/quotaplugin.php
+++ b/tests/lib/connector/sabre/quotaplugin.php
@@ -92,7 +92,10 @@ class Test_OC_Connector_Sabre_QuotaPlugin extends \Test\TestCase {
private function buildFileViewMock($quota) {
// mock filesysten
$view = $this->getMock('\OC\Files\View', array('free_space'), array(), '', false);
- $view->expects($this->any())->method('free_space')->withAnyParameters()->will($this->returnValue($quota));
+ $view->expects($this->any())
+ ->method('free_space')
+ ->with($this->identicalTo(''))
+ ->will($this->returnValue($quota));
return $view;
}