X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FHashtag.php;h=9c90b97b27cce16bc4e54c0100dbb031fe023a74;hb=3bca4fe2a64671d09e08346456cdfa6c12f996e9;hp=411da5ce5eafd0300b0a1d38eb318d59acb53792;hpb=94eca7704130822bf83bb5fee6930dee6bae81dd;p=friendica.git diff --git a/src/Module/Hashtag.php b/src/Module/Hashtag.php index 411da5ce5e..9c90b97b27 100644 --- a/src/Module/Hashtag.php +++ b/src/Module/Hashtag.php @@ -1,7 +1,24 @@ . + * */ + namespace Friendica\Module; use Friendica\BaseModule; @@ -14,25 +31,25 @@ use Friendica\Util\Strings; */ class Hashtag extends BaseModule { - - public static function content() + protected function rawContent(array $request = []) { $result = []; - $t = Strings::escapeHtml($_REQUEST['t']); - if (empty($t)) { - System::jsonExit($result); + if (empty($request['t'])) { + $this->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); - System::jsonExit($result); + $this->jsonExit($result); } }