Skip to content

Commit

Permalink
Merge pull request #33749 from nextcloud/backport/33734/stable24
Browse files Browse the repository at this point in the history
[stable24] remove leading slash for search results at mountpoint root
  • Loading branch information
PVince81 authored Sep 1, 2022
2 parents 482671e + ee8cabe commit e76bb27
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/private/Files/Node/Folder.php
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,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);
}
Expand Down

0 comments on commit e76bb27

Please sign in to comment.