]> git.mxchange.org Git - friendica.git/commitdiff
Exclude [img] tags from tag replacement
authorHypolite Petovan <hypolite@mrpetovan.com>
Tue, 16 Jun 2020 20:34:16 +0000 (16:34 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Tue, 16 Jun 2020 20:34:16 +0000 (16:34 -0400)
- It broke image captions by inserting an HTML link inside an HTML attribute

mod/item.php
src/Content/Text/BBCode.php

index 651c2224cb97fb1694dc445c895f87e1315a1cd8..6b9905132861c6116bc5b882cadbc37619888d9f 100644 (file)
@@ -375,7 +375,7 @@ function item_post(App $a) {
        $only_to_forum = false;
        $forum_contact = [];
 
-       $body = BBCode::performWithEscapedTags($body, ['noparse', 'pre', 'code'], function ($body) use ($profile_uid, $network, $str_contact_allow, &$inform, &$private_forum, &$private_id, &$only_to_forum, &$forum_contact) {
+       $body = BBCode::performWithEscapedTags($body, ['noparse', 'pre', 'code', 'img'], function ($body) use ($profile_uid, $network, $str_contact_allow, &$inform, &$private_forum, &$private_id, &$only_to_forum, &$forum_contact) {
                $tags = BBCode::getTags($body);
 
                $tagged = [];
index d7fda23aebedd3def4bd7bb104c04088a56435c7..09d03106869890a1642e8f4de1d83b0b4f4b6bac 100644 (file)
@@ -2188,7 +2188,7 @@ class BBCode
         */
        public static function setMentions($body, $profile_uid = 0, $network = '')
        {
-               BBCode::performWithEscapedTags($body, ['noparse', 'pre', 'code'], function ($body) use ($profile_uid, $network) {
+               BBCode::performWithEscapedTags($body, ['noparse', 'pre', 'code', 'img'], function ($body) use ($profile_uid, $network) {
                        $tags = BBCode::getTags($body);
 
                        $tagged = [];
@@ -2211,7 +2211,7 @@ class BBCode
                                        }
                                }
 
-                       $success = Item::replaceTag($body, $inform, $profile_uid, $tag, $network);
+                               $success = Item::replaceTag($body, $inform, $profile_uid, $tag, $network);
 
                                if ($success['replaced']) {
                                        $tagged[] = $tag;