diff options
author | Morris Jobke <hey@morrisjobke.de> | 2015-02-26 15:42:53 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2015-02-26 15:42:53 +0100 |
commit | 522469614b96ab3ce8edae87c0f9da1079166ac7 (patch) | |
tree | 44490b2f7b72aa3f5bbcbf045d83003079ae1542 /lib | |
parent | 55b3f6b9863344b6ba5e2123db3e5416ab0973da (diff) | |
parent | ae2f37ac06514dc53fd192c04aebdf9f51d03b04 (diff) | |
download | nextcloud-server-522469614b96ab3ce8edae87c0f9da1079166ac7.tar.gz nextcloud-server-522469614b96ab3ce8edae87c0f9da1079166ac7.zip |
Merge pull request #14505 from owncloud/dav-copy-fix
Fixes WebDAV copy
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/connector/sabre/objecttree.php | 18 |
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..c8416450463 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 + $this->getNodeForPath($source); - } - } - } + try { + $this->fileView->copy($source, $destination); } catch (\OCP\Files\StorageNotAvailableException $e) { throw new \Sabre\DAV\Exception\ServiceUnavailable($e->getMessage()); } |