]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Hashtag.php
Use rawContent for Special Options to avoid a protected options() method
[friendica.git] / src / Module / Hashtag.php
index 06c6374e3435020ab9f86f8b2ae102bfa2e6c1c0..471515e6296ea4cccdc63a0833454b035a720eb6 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2022, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -25,15 +25,13 @@ use Friendica\BaseModule;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
 use Friendica\Util\Strings;
-use Friendica\Model\Term;
 
 /**
  * Hashtag module.
  */
 class Hashtag extends BaseModule
 {
-
-       public static function content(array $parameters = [])
+       protected function content(array $request = []): string
        {
                $result = [];
 
@@ -42,15 +40,14 @@ class Hashtag extends BaseModule
                        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 ?", $t . "%"], ['order' => ['name'], 'limit' => 100]);
                while ($tag = DBA::fetch($taglist)) {
-                       $result[] = ['text' => $tag['term']];
+                       $result[] = ['text' => $tag['name']];
                }
                DBA::close($taglist);
 
                System::jsonExit($result);
+
+               return '';
        }
 }