From d414008b1371ad4e6136a9496c3aa9f3ec61dcdb Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Mon, 29 Aug 2022 17:33:43 +0200 Subject: [PATCH] remove leading slash for search results at mountpoint root Signed-off-by: Robin Appelman --- lib/private/Files/Node/Folder.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/private/Files/Node/Folder.php b/lib/private/Files/Node/Folder.php index 400fd6bedcc8b..7c4ddf5699074 100644 --- a/lib/private/Files/Node/Folder.php +++ b/lib/private/Files/Node/Folder.php @@ -305,7 +305,7 @@ public function search($query) { private function cacheEntryToFileInfo(IMountPoint $mount, string $appendRoot, ICacheEntry $cacheEntry): FileInfo { $cacheEntry['internalPath'] = $cacheEntry['path']; - $cacheEntry['path'] = $appendRoot . $cacheEntry->getPath(); + $cacheEntry['path'] = rtrim($appendRoot . $cacheEntry->getPath(), '/'); $subPath = $cacheEntry['path'] !== '' ? '/' . $cacheEntry['path'] : ''; return new \OC\Files\FileInfo($this->path . $subPath, $mount->getStorage(), $cacheEntry['internalPath'], $cacheEntry, $mount); }