]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Term.php
Merge pull request #5418 from MrPetovan/task/5410-move-dba-to-src
[friendica.git] / src / Model / Term.php
index bed44d6857a0f66580ddb4e8d3ee20aa0a0c9d28..9f0b595014bdaf245ab6c8f4f86cdbad4b3338e9 100644 (file)
@@ -5,9 +5,8 @@
 namespace Friendica\Model;
 
 use Friendica\Core\System;
+use Friendica\Database\dba;
 use Friendica\Database\DBM;
-use Friendica\Model\Item;
-use dba;
 
 require_once 'boot.php';
 require_once 'include/conversation.php';
@@ -41,7 +40,11 @@ class Term
                $condition = ['otype' => TERM_OBJ_POST, 'oid' => $itemid, 'type' => [TERM_FILE, TERM_CATEGORY]];
                $tags = dba::select('term', [], $condition);
                while ($tag = dba::fetch($tags)) {
-                       $file_text .= '[' . $tag['term'] . ']';
+                       if ($tag['type'] == TERM_CATEGORY) {
+                               $file_text .= '<' . $tag['term'] . '>';
+                       } else {
+                               $file_text .= '[' . $tag['term'] . ']';
+                       }
                }
                return $file_text;
        }
@@ -233,7 +236,9 @@ class Term
 
                        $orig_tag = $tag["url"];
 
-                       $tag["url"] = Contact::magicLinkById($item['author-id'], $tag['url']);
+                       $author = ['uid' => 0, 'id' => $item['author-id'],
+                               'network' => $item['author-network'], 'url' => $item['author-link']];
+                       $tag["url"] = Contact::magicLinkByContact($author, $tag['url']);
 
                        if ($tag["type"] == TERM_HASHTAG) {
                                if ($orig_tag != $tag["url"]) {