From: Roeland Jago Douma Date: Sat, 22 Jul 2017 12:37:55 +0000 (+0200) Subject: Empty search no longer works X-Git-Tag: v12.0.3RC1~91^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e73f46e344a0ea8f77d36ababbb2ad05835fbb38;p=nextcloud-server.git Empty search no longer works Signed-off-by: Roeland Jago Douma --- diff --git a/lib/private/Preview/Watcher.php b/lib/private/Preview/Watcher.php index 0b87bcda86e..8d091b84b0e 100644 --- a/lib/private/Preview/Watcher.php +++ b/lib/private/Preview/Watcher.php @@ -77,10 +77,16 @@ class Watcher { } /** @var Folder $node */ - $nodes = $node->search(''); + $this->deleteFolder($node); + } + + private function deleteFolder(Folder $folder) { + $nodes = $folder->getDirectoryListing(); foreach ($nodes as $node) { if ($node instanceof File) { $this->toDelete[] = $node->getId(); + } else if ($node instanceof Folder) { + $this->deleteFolder($node); } } }