Update src/Module/Api/Mastodon/Search.php

Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
This commit is contained in:
Artur Weigandt 2025-02-27 12:50:19 +01:00 committed by GitHub
parent 3bc3f5fe4d
commit 354d13167e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -193,14 +193,10 @@ class Search extends BaseApi
$condition = ["`id` IN (SELECT `tid` FROM `post-tag` WHERE `type` = ?) AND `name` LIKE ?", Tag::HASHTAG, $q . '%']; $condition = ["`id` IN (SELECT `tid` FROM `post-tag` WHERE `type` = ?) AND `name` LIKE ?", Tag::HASHTAG, $q . '%'];
$tags = DBA::select('tag', ['name'], $condition, $params); $tags = DBA::selectToArray('tag', ['name'], $condition, $params);
$hashtags = []; $hashtags = [];
if (!is_iterable($tags)) {
return $hashtags;
}
foreach ($tags as $tag) { foreach ($tags as $tag) {
if ($version == 1) { if ($version == 1) {
$hashtags[] = $tag['name']; $hashtags[] = $tag['name'];