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, 5 insertions, 2 deletions
diff --git a/lib/private/connector/sabre/objecttree.php b/lib/private/connector/sabre/objecttree.php
index 5edd949eeaf..04ca1d7104d 100644
--- a/lib/private/connector/sabre/objecttree.php
+++ b/lib/private/connector/sabre/objecttree.php
@@ -11,6 +11,7 @@ namespace OC\Connector\Sabre;
use OC\Files\FileInfo;
use OC\Files\Filesystem;
use OC\Files\Mount\MoveableMount;
+use OC_Connector_Sabre_Exception_InvalidPath;
use OCP\Files\StorageInvalidException;
use OCP\Files\StorageNotAvailableException;
@@ -185,8 +186,10 @@ class ObjectTree extends \Sabre\DAV\Tree {
}
$fileName = basename($destinationPath);
- if (!\OCP\Util::isValidFileName($fileName)) {
- throw new \Sabre\DAV\Exception\BadRequest();
+ try {
+ $this->fileView->verifyPath($destinationDir, $fileName);
+ } catch (\OCP\Files\InvalidPathException $ex) {
+ throw new OC_Connector_Sabre_Exception_InvalidPath($ex->getMessage());
}
$renameOkay = $this->fileView->rename($sourcePath, $destinationPath);