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:
commit
4789e87a53
|
@ -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);
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue