From 332ab6641cb2402c9f5f4b216ad8687754bad3e0 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 26 Nov 2023 09:27:59 -0500 Subject: [PATCH] Pass actual string character to ctype_space in Content\Smilies::performForEachWordMatch - Address part of https://github.com/friendica/friendica/issues/12011#issuecomment-1826792949 --- src/Content/Smilies.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Content/Smilies.php b/src/Content/Smilies.php index 01ac832eac..29752701f0 100644 --- a/src/Content/Smilies.php +++ b/src/Content/Smilies.php @@ -224,10 +224,10 @@ class Smilies if (strlen($word) < 2) { continue; } - $ord1 = ord($word); + $ord1 = ord($word[0]); $ord2 = ord($word[1]); // A smiley shortcode must not begin or end with whitespaces. - if (ctype_space($ord1) || ctype_space($word[strlen($word) - 1])) { + if (ctype_space($word[0]) || ctype_space($word[strlen($word) - 1])) { continue; } $ord1_bitset |= 1 << ($ord1 & 31); -- 2.39.5