Add FIXME

- Current implementation is failing tests with emojis including the zero-width-joiner character, encoded on 3 bytes only.
This commit is contained in:
Hypolite Petovan 2023-08-29 22:17:48 -04:00
parent 059a111282
commit 64b5f93a6a

View File

@ -296,7 +296,7 @@ class Smilies
{ {
// Strips all whitespace // Strips all whitespace
$conv = preg_replace('#\s#u', '', html_entity_decode($body)); $conv = preg_replace('#\s#u', '', html_entity_decode($body));
// Emojis are always 4 byte Unicode characters // @FIXME Emojis are almost always 4 byte Unicode characters, except when they include the zero-width joiner character, encoded on 3 bytes
return (!empty($conv) && (strlen($conv) / mb_strlen($conv) == 4)); return (!empty($conv) && (strlen($conv) / mb_strlen($conv) == 4));
} }
} }