Update src/Module/Api/Mastodon/Search.php
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
This commit is contained in:
parent
3bc3f5fe4d
commit
354d13167e
1 changed files with 1 additions and 5 deletions
|
@ -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'];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue