From e2c38f13476e0d2c78d8518b86a25d8dd99150fb Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Fri, 22 Jan 2021 17:45:28 -0500 Subject: [PATCH] Prevent hashtag parsing and replacement in image alternative text --- src/Content/Text/BBCode.php | 2 +- src/Model/Item.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Content/Text/BBCode.php b/src/Content/Text/BBCode.php index ded3e2fd23..66c180052d 100644 --- a/src/Content/Text/BBCode.php +++ b/src/Content/Text/BBCode.php @@ -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); diff --git a/src/Model/Item.php b/src/Model/Item.php index 7d2e363fbf..393fead5f8 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -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?