]> git.mxchange.org Git - friendica.git/commitdiff
Prevent hashtag parsing and replacement in image alternative text
authorHypolite Petovan <hypolite@mrpetovan.com>
Fri, 22 Jan 2021 22:45:28 +0000 (17:45 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Fri, 22 Jan 2021 22:45:28 +0000 (17:45 -0500)
src/Content/Text/BBCode.php
src/Model/Item.php

index ded3e2fd23e994ffb9a21fc02c2688061cb43f31..66c180052d89c7abf875345e571f85e0dadeaeac 100644 (file)
@@ -2066,7 +2066,7 @@ class BBCode
        {
                $ret = [];
 
-               BBCode::performWithEscapedTags($string, ['noparse', 'pre', 'code'], function ($string) use (&$ret) {
+               BBCode::performWithEscapedTags($string, ['noparse', 'pre', 'code', 'img'], function ($string) use (&$ret) {
                        // Convert hashtag links to hashtags
                        $string = preg_replace('/#\[url\=([^\[\]]*)\](.*?)\[\/url\]/ism', '#$2 ', $string);
 
index 7d2e363fbff84a306e7798386c1fb7220c821855..393fead5f8bc215891aee91aaa6133f2f2d1019f 100644 (file)
@@ -1866,7 +1866,7 @@ class Item
 
        public static function setHashtags($body)
        {
-               $body = BBCode::performWithEscapedTags($body, ['noparse', 'pre', 'code'], function ($body) {
+               $body = BBCode::performWithEscapedTags($body, ['noparse', 'pre', 'code', 'img'], function ($body) {
                        $tags = BBCode::getTags($body);
 
                        // No hashtags?