]> git.mxchange.org Git - friendica.git/blobdiff - src/Content/Item.php
Merge pull request #10551 from annando/profiler
[friendica.git] / src / Content / Item.php
index c0b1d3b49a37d3baf1aaffd69245aec129965836..56836903b3c6ff91694cf3e2df1b4ef8db4bfdda 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2021, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -23,8 +23,8 @@ namespace Friendica\Content;
 
 use Friendica\Database\DBA;
 use Friendica\Model\Contact;
-use Friendica\Model\FileTag;
 use Friendica\Model\Tag;
+use Friendica\Model\Post;
 
 /**
  * A content helper class for displaying items
@@ -64,7 +64,7 @@ class Item
                $folders = [];
                $first = true;
 
-               foreach (FileTag::fileToArray($item['file'] ?? '', 'category') as $savedFolderName) {
+               foreach (Post\Category::getArrayByURIId($item['uri-id'], $item['uid'], Post\Category::CATEGORY) as $savedFolderName) {
                        if (!empty($item['author-link'])) {
                                $url = $item['author-link'] . "?category=" . rawurlencode($savedFolderName);
                        } else {
@@ -85,7 +85,7 @@ class Item
                }
 
                if (local_user() == $item['uid']) {
-                       foreach (FileTag::fileToArray($item['file'] ?? '') as $savedFolderName) {
+                       foreach (Post\Category::getArrayByURIId($item['uri-id'], $item['uid'], Post\Category::FILE) as $savedFolderName) {
                                $folders[] = [
                                        'name' => $savedFolderName,
                                        'url' => "#",
@@ -127,16 +127,6 @@ class Item
                        $tag_type = substr($tag, 0, 1);
                        //is it already replaced?
                        if (strpos($tag, '[url=')) {
-                               // Checking for the alias that is used for OStatus
-                               $pattern = '/[@!]\[url\=(.*?)\](.*?)\[\/url\]/ism';
-                               if (preg_match($pattern, $tag, $matches)) {
-                                       $data = Contact::getByURL($matches[1], false, ['alias', 'nick']);
-
-                                       if ($data['alias'] != '') {
-                                               $newtag = '@[url=' . $data['alias'] . ']' . $data['nick'] . '[/url]';
-                                       }
-                               }
-
                                return $replaced;
                        }