Merge pull request #16276 from owncloud/dav-quota-root

fix webdav quota check for the root of the dav endpoint
This commit is contained in:
Robin Appelman 2015-05-13 14:43:02 +02:00
commit 4789e87a53
2 changed files with 7 additions and 1 deletions

View File

@ -89,6 +89,9 @@ class QuotaPlugin extends \Sabre\DAV\ServerPlugin {
$uri = '/' . $uri; $uri = '/' . $uri;
} }
list($parentUri, $newName) = \Sabre\HTTP\URLUtil::splitPath($uri); list($parentUri, $newName) = \Sabre\HTTP\URLUtil::splitPath($uri);
if(is_null($parentUri)) {
$parentUri = '';
}
$req = $this->server->httpRequest; $req = $this->server->httpRequest;
if ($req->getHeader('OC-Chunked')) { if ($req->getHeader('OC-Chunked')) {
$info = \OC_FileChunking::decodeName($newName); $info = \OC_FileChunking::decodeName($newName);

View File

@ -92,7 +92,10 @@ class Test_OC_Connector_Sabre_QuotaPlugin extends \Test\TestCase {
private function buildFileViewMock($quota) { private function buildFileViewMock($quota) {
// mock filesysten // mock filesysten
$view = $this->getMock('\OC\Files\View', array('free_space'), array(), '', false); $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; return $view;
} }