From 95f099d26c824978536f36311f70fa5fd3e7dd35 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Fri, 18 Dec 2020 10:37:25 -0500 Subject: [PATCH 1/2] Restore Mastodon emoji span classes - Fix typo in replacement of [class] tag --- src/Content/Text/BBCode.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Content/Text/BBCode.php b/src/Content/Text/BBCode.php index 73503cece..d238e265e 100644 --- a/src/Content/Text/BBCode.php +++ b/src/Content/Text/BBCode.php @@ -50,7 +50,7 @@ use Friendica\Util\XML; class BBCode { // Update this value to the current date whenever changes are made to BBCode::convert - const VERSION = '2020-12-06'; + const VERSION = '2020-12-18-small-emojis'; const INTERNAL = 0; const API = 2; @@ -1467,7 +1467,7 @@ class BBCode $text = preg_replace("(\[style=(.*?)\](.*?)\[\/style\])ism", '$2', $text); // Check for CSS classes - $text = preg_replace("(\[class=(.*?)\](.*?)\[\/class\])ism", '$2', $text); + $text = preg_replace("(\[class=(.*?)\](.*?)\[\/class\])ism", '$2', $text); // handle nested lists $endlessloop = 0; From 28d850b95dd505bb22a24df4c79e38105ce7e6a9 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Fri, 18 Dec 2020 11:11:48 -0500 Subject: [PATCH 2/2] Add BBCode test for issue #9639 --- tests/src/Content/Text/BBCodeTest.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/src/Content/Text/BBCodeTest.php b/tests/src/Content/Text/BBCodeTest.php index 1769e6fd7..2eb5d1903 100644 --- a/tests/src/Content/Text/BBCodeTest.php +++ b/tests/src/Content/Text/BBCodeTest.php @@ -277,6 +277,10 @@ class BBCodeTest extends MockedTest 'expectedHTML' => 'dare to move your mouse here', 'text' => '[color=FFFFFF]dare to move your mouse here[/color]' ], + 'bug-9639-span-classes' => [ + 'expectedHTML' => 'Test', + 'text' => '[class=arbitrary classes]Test[/class]', + ], ]; }