]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Tag.php
Ensure to reset the avatar paths when deleting avatar cache
[friendica.git] / src / Model / Tag.php
index 2f034e92b7767846b005a0fea7697d38f7a8b8e5..8509c309387aa670db010de3b97a8ccc4e862a77 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2022, the Friendica project
+ * @copyright Copyright (C) 2010-2023, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -119,7 +119,7 @@ class Tag
                                $tag = DBA::selectFirst('tag', ['name', 'type'], ['url' => $url]);
                                if (!empty($tag)) {
                                        if ($tag['name'] != substr($name, 0, 96)) {
-                                               DBA::update('tag', ['name' => substr($name, 0, 96)], ['url' => $url]);
+                                               DBA::update('tag', ['name' => substr($name, 0, 96)], ['url' => $url, 'type' => $tag['type']]);
                                        }
                                        if (!empty($target) && ($tag['type'] != $target)) {
                                                DBA::update('tag', ['type' => $target], ['url' => $url]);
@@ -319,16 +319,12 @@ class Tag
                        $tags = self::TAG_CHARACTER[self::HASHTAG] . self::TAG_CHARACTER[self::MENTION] . self::TAG_CHARACTER[self::EXCLUSIVE_MENTION];
                }
 
-               // Only remove the shared data from "real" reshares
-               $shared = DI::contentItem()->getSharedPost($item, ['uri-id']);
-               if (!empty($shared)) {
-                       $item['body'] = BBCode::removeSharedData($item['body']);
-               }
-
                foreach (self::getFromBody($item['body'], $tags) as $tag) {
                        self::storeByHash($item['uri-id'], $tag[1], $tag[3], $tag[2]);
                }
 
+               $shared = DI::contentItem()->getSharedPost($item, ['uri-id']);
+
                // Search for hashtags in the shared body (but only if hashtags are wanted)
                if (!empty($shared) && (strpos($tags, self::TAG_CHARACTER[self::HASHTAG]) !== false)) {
                        foreach (self::getByURIId($shared['post']['uri-id'], [self::HASHTAG]) as $tag) {