diff options
Diffstat (limited to 'apps/dav/lib/Connector/Sabre/Node.php')
-rw-r--r-- | apps/dav/lib/Connector/Sabre/Node.php | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/apps/dav/lib/Connector/Sabre/Node.php b/apps/dav/lib/Connector/Sabre/Node.php index 1e32e74c325..2b5661eec63 100644 --- a/apps/dav/lib/Connector/Sabre/Node.php +++ b/apps/dav/lib/Connector/Sabre/Node.php @@ -100,11 +100,13 @@ abstract class Node implements \Sabre\DAV\INode { if ($info instanceof Folder || $info instanceof File) { $this->node = $info; } else { + // The Node API assumes that the view passed doesn't have a fake root + $rootView = \OC::$server->get(View::class); $root = \OC::$server->get(IRootFolder::class); if ($info->getType() === FileInfo::TYPE_FOLDER) { - $this->node = new Folder($root, $view, $this->path, $info); + $this->node = new Folder($root, $rootView, $this->fileView->getAbsolutePath($this->path), $info); } else { - $this->node = new File($root, $view, $this->path, $info); + $this->node = new File($root, $rootView, $this->fileView->getAbsolutePath($this->path), $info); } } } @@ -112,10 +114,11 @@ abstract class Node implements \Sabre\DAV\INode { protected function refreshInfo() { $this->info = $this->fileView->getFileInfo($this->path); $root = \OC::$server->get(IRootFolder::class); + $rootView = \OC::$server->get(View::class); if ($this->info->getType() === FileInfo::TYPE_FOLDER) { - $this->node = new Folder($root, $this->fileView, $this->path, $this->info); + $this->node = new Folder($root, $rootView, $this->path, $this->info); } else { - $this->node = new File($root, $this->fileView, $this->path, $this->info); + $this->node = new File($root, $rootView, $this->path, $this->info); } } |