X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FHashtag.php;h=411da5ce5eafd0300b0a1d38eb318d59acb53792;hb=acaee626f5f23f4c1dc19c31896a0797a251b58f;hp=82cfa1f847a6a25d0d1e6ea80ff01c5be3774992;hpb=27d94023eef0263a3ce9750f79a73ac941a25304;p=friendica.git diff --git a/src/Module/Hashtag.php b/src/Module/Hashtag.php index 82cfa1f847..411da5ce5e 100644 --- a/src/Module/Hashtag.php +++ b/src/Module/Hashtag.php @@ -6,10 +6,8 @@ namespace Friendica\Module; use Friendica\BaseModule; use Friendica\Core\System; -use dba; - -require_once 'include/dba.php'; -require_once 'include/text.php'; +use Friendica\Database\DBA; +use Friendica\Util\Strings; /** * Hashtag module. @@ -21,19 +19,19 @@ class Hashtag extends BaseModule { $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); }