From 6223d06b7e0e87e0253542db31d12bd8ec967c96 Mon Sep 17 00:00:00 2001 From: Evert Pot Date: Mon, 26 Oct 2015 22:57:02 -0400 Subject: [PATCH] Fix caching of root-level nodes. --- lib/DAV/Tree.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/DAV/Tree.php b/lib/DAV/Tree.php index f6e64bccf2..2df544468b 100644 --- a/lib/DAV/Tree.php +++ b/lib/DAV/Tree.php @@ -193,7 +193,9 @@ function getChildren($path) { $node = $this->getNodeForPath($path); $children = $node->getChildren(); - $basePath = trim($path, '/') . '/'; + $basePath = trim($path, '/'); + if ($basePath !== '') $basePath.='/'; + foreach ($children as $child) { $this->cache[$basePath . $child->getName()] = $child;