]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Hashtag.php
Merge pull request #7848 from annando/mail-hooks
[friendica.git] / src / Module / Hashtag.php
index 82cfa1f847a6a25d0d1e6ea80ff01c5be3774992..a460ae1d98887a25562e6299d2f91e9b5347177b 100644 (file)
@@ -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.
@@ -17,23 +15,23 @@ require_once 'include/text.php';
 class Hashtag extends BaseModule
 {
 
-       public static function content()
+       public static function content(array $parameters = [])
        {
                $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);
        }