summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2015-02-25 16:35:13 +0100
committerVincent Petry <pvince81@owncloud.com>2015-02-25 16:35:13 +0100
commitf39fcbc250c3817e0c62627b127cf31a70dca36a (patch)
treee83f2c0c0c2b2eafb6e6ee24b5e27be2dbef603e /lib
parent14c592fe865748f38dd6ee31634d053f83a8e791 (diff)
downloadnextcloud-server-f39fcbc250c3817e0c62627b127cf31a70dca36a.tar.gz
nextcloud-server-f39fcbc250c3817e0c62627b127cf31a70dca36a.zip
Fixes WebDAV copy
- added existence check for source argument - removed extra logic for folders, as $view->copy() already supports that internally
Diffstat (limited to 'lib')
-rw-r--r--lib/private/connector/sabre/objecttree.php18
1 files changed, 4 insertions, 14 deletions
diff --git a/lib/private/connector/sabre/objecttree.php b/lib/private/connector/sabre/objecttree.php
index 585be637813..e13d4ded91b 100644
--- a/lib/private/connector/sabre/objecttree.php
+++ b/lib/private/connector/sabre/objecttree.php
@@ -234,21 +234,11 @@ class ObjectTree extends \Sabre\DAV\Tree {
throw new \Sabre\DAV\Exception\ServiceUnavailable('filesystem not setup');
}
- try {
- if ($this->fileView->is_file($source)) {
- $this->fileView->copy($source, $destination);
- } else {
- $this->fileView->mkdir($destination);
- $dh = $this->fileView->opendir($source);
- if (is_resource($dh)) {
- while (($subNode = readdir($dh)) !== false) {
-
- if ($subNode == '.' || $subNode == '..') continue;
- $this->copy($source . '/' . $subNode, $destination . '/' . $subNode);
+ // this will trigger existence check
+ $node = $this->getNodeForPath($source);
- }
- }
- }
+ try {
+ $this->fileView->copy($source, $destination);
} catch (\OCP\Files\StorageNotAvailableException $e) {
throw new \Sabre\DAV\Exception\ServiceUnavailable($e->getMessage());
}