28 lines
948 B
Diff
28 lines
948 B
Diff
diff --git a/lib/DAV/Tree.php b/lib/DAV/Tree.php
|
|
index 65b4583ceb..1483e1bc51 100644
|
|
--- a/lib/DAV/Tree.php
|
|
+++ b/lib/DAV/Tree.php
|
|
@@ -62,9 +62,21 @@ public function getNodeForPath($path)
|
|
return $this->rootNode;
|
|
}
|
|
|
|
- $parts = explode('/', $path);
|
|
$node = $this->rootNode;
|
|
|
|
+ // look for any cached parent and collect the parts below the parent
|
|
+ $parts = [];
|
|
+ $remainingPath = $path;
|
|
+ do {
|
|
+ list($remainingPath, $baseName) = Uri\split($remainingPath);
|
|
+ array_unshift($parts, $baseName);
|
|
+
|
|
+ if (isset($this->cache[$remainingPath])) {
|
|
+ $node = $this->cache[$remainingPath];
|
|
+ break;
|
|
+ }
|
|
+ } while ('' !== $remainingPath);
|
|
+
|
|
while (count($parts)) {
|
|
if (!($node instanceof ICollection)) {
|
|
throw new Exception\NotFound('Could not find node at path: '.$path);
|