summaryrefslogtreecommitdiffstats
path: root/apps/dav/lib
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@owncloud.com>2015-10-27 09:14:28 +0100
committerRoeland Jago Douma <rullzer@owncloud.com>2015-10-27 09:22:33 +0100
commitdb17598a0e99a1dc8b789fc9523667fe905eb9ef (patch)
tree89214de48586311ecd4ede28ac2b2f08774dc9a9 /apps/dav/lib
parent0875a4a18fcdbc40fa856f469c0de77b8fcaf539 (diff)
downloadnextcloud-server-db17598a0e99a1dc8b789fc9523667fe905eb9ef.tar.gz
nextcloud-server-db17598a0e99a1dc8b789fc9523667fe905eb9ef.zip
Verify the src exists in webdav MOVE
* Unit test added
Diffstat (limited to 'apps/dav/lib')
-rw-r--r--apps/dav/lib/connector/sabre/filesplugin.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/apps/dav/lib/connector/sabre/filesplugin.php b/apps/dav/lib/connector/sabre/filesplugin.php
index c9fc78a795f..61b5360cac1 100644
--- a/apps/dav/lib/connector/sabre/filesplugin.php
+++ b/apps/dav/lib/connector/sabre/filesplugin.php
@@ -132,6 +132,10 @@ class FilesPlugin extends \Sabre\DAV\ServerPlugin {
if ($sourceDir !== $destinationDir) {
$sourceFileInfo = $this->fileView->getFileInfo($source);
+ if ($sourceFileInfo === false) {
+ throw new \Sabre\DAV\Exception\NotFound($source . ' does not exist');
+ }
+
if (!$sourceFileInfo->isDeletable()) {
throw new \Sabre\DAV\Exception\Forbidden($source . " cannot be deleted");
}