mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
dont include folder being search in in the results
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
8ebbd91909
commit
9884344230
1 changed files with 7 additions and 1 deletions
|
|
@ -280,6 +280,11 @@ class Folder extends Node implements \OCP\Files\Folder {
|
|||
}, $results);
|
||||
}, array_values($resultsPerCache), array_keys($resultsPerCache)));
|
||||
|
||||
// don't include this folder in the results
|
||||
$files = array_filter($files, function (FileInfo $file) {
|
||||
return $file->getPath() !== $this->getPath();
|
||||
});
|
||||
|
||||
// since results were returned per-cache, they are no longer fully sorted
|
||||
$order = $query->getOrder();
|
||||
if ($order) {
|
||||
|
|
@ -302,7 +307,8 @@ class Folder extends Node implements \OCP\Files\Folder {
|
|||
private function cacheEntryToFileInfo(IMountPoint $mount, string $appendRoot, ICacheEntry $cacheEntry): FileInfo {
|
||||
$cacheEntry['internalPath'] = $cacheEntry['path'];
|
||||
$cacheEntry['path'] = $appendRoot . $cacheEntry->getPath();
|
||||
return new \OC\Files\FileInfo($this->path . '/' . $cacheEntry['path'], $mount->getStorage(), $cacheEntry['internalPath'], $cacheEntry, $mount);
|
||||
$subPath = $cacheEntry['path'] !== '' ? '/' . $cacheEntry['path'] : '';
|
||||
return new \OC\Files\FileInfo($this->path . $subPath, $mount->getStorage(), $cacheEntry['internalPath'], $cacheEntry, $mount);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue