From dbb33399bc510801914ccd3f601fd6eb952c4ec6 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 15 Nov 2020 00:12:26 -0500 Subject: [PATCH] Prevent image descriptions from being replaced by local smilies - AP-received emojis have their code in the image description --- src/Content/Text/BBCode.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Content/Text/BBCode.php b/src/Content/Text/BBCode.php index b1cfff0a4..edd73ce10 100644 --- a/src/Content/Text/BBCode.php +++ b/src/Content/Text/BBCode.php @@ -1699,7 +1699,9 @@ class BBCode // Replace non graphical smilies for external posts if (!$nosmile && !$for_plaintext) { - $text = Smilies::replace($text); + $text = self::performWithEscapedTags($text, ['img'], function ($text) { + return Smilies::replace($text); + }); } if (!$for_plaintext && DI::config()->get('system', 'big_emojis') && ($simple_html != self::DIASPORA)) {