]> git.mxchange.org Git - friendica.git/commitdiff
Pass actual string character to ctype_space in Content\Smilies::performForEachWordMatch
authorHypolite Petovan <hypolite@mrpetovan.com>
Sun, 26 Nov 2023 14:27:59 +0000 (09:27 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Sun, 26 Nov 2023 14:27:59 +0000 (09:27 -0500)
- Address part of https://github.com/friendica/friendica/issues/12011#issuecomment-1826792949

src/Content/Smilies.php

index 01ac832eac8c71dff739de5183d55763cbed71cf..29752701f0fe2491bf27f1f10b0776d10bd7e4b8 100644 (file)
@@ -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);