Fixes WebDAV copy
- added existence check for source argument - removed extra logic for folders, as $view->copy() already supports that internally
This commit is contained in:
parent
14c592fe86
commit
f39fcbc250
|
@ -234,21 +234,11 @@ class ObjectTree extends \Sabre\DAV\Tree {
|
|||
throw new \Sabre\DAV\Exception\ServiceUnavailable('filesystem not setup');
|
||||
}
|
||||
|
||||
// this will trigger existence check
|
||||
$node = $this->getNodeForPath($source);
|
||||
|
||||
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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (\OCP\Files\StorageNotAvailableException $e) {
|
||||
throw new \Sabre\DAV\Exception\ServiceUnavailable($e->getMessage());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue