aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/Connector
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2023-02-18 15:43:39 +0100
committerSimon L <szaimen@e.mail.de>2023-04-17 23:46:52 +0200
commit160bd75d0ad59b3692ae2e904be52c9e4e7295f4 (patch)
treef2edd76f77c54c6d356ea14ab5e6b141716da01f /apps/dav/lib/Connector
parent85c9e75f33c0c46bc33023d1f4af05f149d480c3 (diff)
downloadnextcloud-server-160bd75d0ad59b3692ae2e904be52c9e4e7295f4.tar.gz
nextcloud-server-160bd75d0ad59b3692ae2e904be52c9e4e7295f4.zip
fix: Use proper path when creating node instances
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'apps/dav/lib/Connector')
-rw-r--r--apps/dav/lib/Connector/Sabre/Node.php11
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 2c8d313eefd..c9407b12786 100644
--- a/apps/dav/lib/Connector/Sabre/Node.php
+++ b/apps/dav/lib/Connector/Sabre/Node.php
@@ -91,11 +91,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);
}
}
}
@@ -107,10 +109,11 @@ abstract class Node implements \Sabre\DAV\INode {
}
$this->info = $info;
$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);
}
}