Skip to content

Commit 9ea300d

Browse files
committed
fixup! fixup! fix: add INodeByPath to Directory [wip]
Signed-off-by: Salvatore Martire <[email protected]>
1 parent 2e6416a commit 9ea300d

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

apps/dav/lib/Connector/Sabre/Directory.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -498,11 +498,8 @@ public function getNode(): Folder {
498498
}
499499

500500
public function getNodeForPath($path) {
501-
$nodePath = ltrim($this->path, '/');
502-
// path may be a partial path, due to caching in Tree.php
503-
$fullPath = str_starts_with($path, $nodePath) ? $path
504-
: $nodePath . '/'
505-
. $path;
501+
$nodeIsRoot = $this->path === '/';
502+
$fullPath = $nodeIsRoot ? $this->path . $path : $this->path . '/' . $path;
506503

507504
try {
508505
[$destinationDir, $destinationName] = \Sabre\Uri\split($fullPath);

0 commit comments

Comments
 (0)