Skip to content

Commit 268e6af

Browse files
authored
Merge pull request #27775 from nextcloud/backport/27750/stable22
2 parents 6c24e13 + cb0e761 commit 268e6af

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/private/Files/Node/Folder.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,11 @@ public function search($query) {
280280
}, $results);
281281
}, array_values($resultsPerCache), array_keys($resultsPerCache)));
282282

283+
// don't include this folder in the results
284+
$files = array_filter($files, function (FileInfo $file) {
285+
return $file->getPath() !== $this->getPath();
286+
});
287+
283288
// since results were returned per-cache, they are no longer fully sorted
284289
$order = $query->getOrder();
285290
if ($order) {
@@ -302,7 +307,8 @@ public function search($query) {
302307
private function cacheEntryToFileInfo(IMountPoint $mount, string $appendRoot, ICacheEntry $cacheEntry): FileInfo {
303308
$cacheEntry['internalPath'] = $cacheEntry['path'];
304309
$cacheEntry['path'] = $appendRoot . $cacheEntry->getPath();
305-
return new \OC\Files\FileInfo($this->path . '/' . $cacheEntry['path'], $mount->getStorage(), $cacheEntry['internalPath'], $cacheEntry, $mount);
310+
$subPath = $cacheEntry['path'] !== '' ? '/' . $cacheEntry['path'] : '';
311+
return new \OC\Files\FileInfo($this->path . $subPath, $mount->getStorage(), $cacheEntry['internalPath'], $cacheEntry, $mount);
306312
}
307313

308314
/**

0 commit comments

Comments
 (0)