diff --git a/core/imageboard/search.php b/core/imageboard/search.php index 7e153fe8..b71803fc 100644 --- a/core/imageboard/search.php +++ b/core/imageboard/search.php @@ -146,7 +146,7 @@ class Search /** * Count the number of image results for a given search * - * @param string[] $tags + * @param list $tags */ public static function count_images(array $tags = []): int { diff --git a/ext/danbooru_api/main.php b/ext/danbooru_api/main.php index e950ee2a..d29a3eee 100644 --- a/ext/danbooru_api/main.php +++ b/ext/danbooru_api/main.php @@ -197,6 +197,7 @@ class DanbooruApi extends Extension $tags = array_filter($tags, static function ($element) { return $element !== "*"; }); + $tags = array_values($tags); // reindex array because count_images() expects a 0-based array $count = Search::count_images($tags); $results = Search::find_images(max($start, 0), min($limit, 100), $tags); }