summaryrefslogtreecommitdiffstats
path: root/lib/private/connector/sabre/objecttree.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/connector/sabre/objecttree.php')
-rw-r--r--lib/private/connector/sabre/objecttree.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/private/connector/sabre/objecttree.php b/lib/private/connector/sabre/objecttree.php
index 8def14e8e9c..17d9aff8f68 100644
--- a/lib/private/connector/sabre/objecttree.php
+++ b/lib/private/connector/sabre/objecttree.php
@@ -249,6 +249,13 @@ class ObjectTree extends \Sabre\DAV\Tree {
// this will trigger existence check
$this->getNodeForPath($source);
+ list($destinationDir, $destinationName) = \Sabre\HTTP\URLUtil::splitPath($destination);
+ try {
+ $this->fileView->verifyPath($destinationDir, $destinationName);
+ } catch (\OCP\Files\InvalidPathException $ex) {
+ throw new InvalidPath($ex->getMessage());
+ }
+
try {
$this->fileView->copy($source, $destination);
} catch (\OCP\Files\StorageNotAvailableException $e) {