Pass actual string character to ctype_space in Content\Smilies::performForEachWordMatch

- Address part of https://github.com/friendica/friendica/issues/12011#issuecomment-1826792949
This commit is contained in:
Hypolite Petovan 2023-11-26 09:27:59 -05:00
parent 3c35dbcb5f
commit 332ab6641c

View File

@ -224,10 +224,10 @@ class Smilies
if (strlen($word) < 2) { if (strlen($word) < 2) {
continue; continue;
} }
$ord1 = ord($word); $ord1 = ord($word[0]);
$ord2 = ord($word[1]); $ord2 = ord($word[1]);
// A smiley shortcode must not begin or end with whitespaces. // 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; continue;
} }
$ord1_bitset |= 1 << ($ord1 & 31); $ord1_bitset |= 1 << ($ord1 & 31);