X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FHashtag.php;h=411da5ce5eafd0300b0a1d38eb318d59acb53792;hb=f3da5b3a2f98883e4a06c345dfe2880394f7d21d;hp=879b27ea7a73dcc219d991e739eb91f0286a59b3;hpb=96c086ea139047fc893ffb51843d3e24c5422c44;p=friendica.git diff --git a/src/Module/Hashtag.php b/src/Module/Hashtag.php index 879b27ea7a..411da5ce5e 100644 --- a/src/Module/Hashtag.php +++ b/src/Module/Hashtag.php @@ -6,30 +6,32 @@ namespace Friendica\Module; use Friendica\BaseModule; use Friendica\Core\System; -use dba; +use Friendica\Database\DBA; +use Friendica\Util\Strings; /** * Hashtag module. */ -class Hashtag extends BaseModule { - - public static function init() +class Hashtag extends BaseModule { + + public static function content() + { $result = []; - $t = escape_tags($_REQUEST['t']); + $t = Strings::escapeHtml($_REQUEST['t']); if (empty($t)) { System::jsonExit($result); } - $taglist = dba::p("SELECT DISTINCT(`term`) FROM `term` WHERE `term` LIKE ? AND `type` = ? ORDER BY `term`", + $taglist = DBA::p("SELECT DISTINCT(`term`) FROM `term` WHERE `term` LIKE ? AND `type` = ? ORDER BY `term`", $t . '%', intval(TERM_HASHTAG) ); - while ($tag = dba::fetch($taglist)) { - $result[] = ['text' => strtolower($tag['term'])]; + while ($tag = DBA::fetch($taglist)) { + $result[] = ['text' => $tag['term']]; } - dba::close($taglist); + DBA::close($taglist); System::jsonExit($result); }