From 64b5f93a6a161e58a7677f92ef92c421ac750ad8 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Tue, 29 Aug 2023 22:17:48 -0400 Subject: [PATCH] Add FIXME - Current implementation is failing tests with emojis including the zero-width-joiner character, encoded on 3 bytes only. --- src/Content/Smilies.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Content/Smilies.php b/src/Content/Smilies.php index 664a4089ce..8744e19995 100644 --- a/src/Content/Smilies.php +++ b/src/Content/Smilies.php @@ -296,7 +296,7 @@ class Smilies { // Strips all whitespace $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)); } }