X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=src%2FModule%2FHashtag.php;h=0c4c41c7e17c002334069025c9a17b8f82ed2333;hb=649bbaa4c3d28cdf4cb8544ff2f92ba493023953;hp=a460ae1d98887a25562e6299d2f91e9b5347177b;hpb=8c03bdada92845974ecadeecb9e673c7ffac22b4;p=friendica.git diff --git a/src/Module/Hashtag.php b/src/Module/Hashtag.php index a460ae1d98..0c4c41c7e1 100644 --- a/src/Module/Hashtag.php +++ b/src/Module/Hashtag.php @@ -1,7 +1,24 @@ . + * */ + namespace Friendica\Module; use Friendica\BaseModule; @@ -14,22 +31,22 @@ use Friendica\Util\Strings; */ class Hashtag extends BaseModule { - - public static function content(array $parameters = []) + protected function rawContent(array $request = []) { $result = []; - $t = Strings::escapeHtml($_REQUEST['t']); - if (empty($t)) { + if (empty($request['t'])) { System::jsonExit($result); } - $taglist = DBA::p("SELECT DISTINCT(`term`) FROM `term` WHERE `term` LIKE ? AND `type` = ? ORDER BY `term`", - $t . '%', - intval(TERM_HASHTAG) + $taglist = DBA::select( + 'tag', + ['name'], + ["`name` LIKE ?", Strings::escapeHtml($request['t']) . "%"], + ['order' => ['name'], 'limit' => 100] ); while ($tag = DBA::fetch($taglist)) { - $result[] = ['text' => $tag['term']]; + $result[] = ['text' => $tag['name']]; } DBA::close($taglist);