Check if at least one author exists when searching for author
authorMarcel Werk <burntime@woltlab.com>
Wed, 18 May 2022 15:39:48 +0000 (17:39 +0200)
committerMarcel Werk <burntime@woltlab.com>
Wed, 18 May 2022 15:39:48 +0000 (17:39 +0200)
wcfsetup/install/files/lib/system/search/SearchHandler.class.php

index 71c7abbd7d397d88b0bef10acb45f7c663a969ca..352452959500ae1bd9e231d56c162de814b5851f 100644 (file)
@@ -68,6 +68,12 @@ final class SearchHandler
     {
         $this->initParameters();
         $this->buildConditions();
+
+        // Check if at least one author exists when searching for author.
+        if (!empty($this->parameters['usernames']) && empty($this->getUserIDs())) {
+            return null;
+        }
+
         $this->buildSearchHash();
 
         if (($search = $this->getExistingSearch()) !== null) {