]> git.mxchange.org Git - friendica.git/commitdiff
Add FIXME
authorHypolite Petovan <hypolite@mrpetovan.com>
Wed, 30 Aug 2023 02:17:48 +0000 (22:17 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Wed, 30 Aug 2023 02:17:48 +0000 (22:17 -0400)
- Current implementation is failing tests with emojis including the zero-width-joiner character, encoded on 3 bytes only.

src/Content/Smilies.php

index 664a4089ce9722f07d35067eb553d8c4d31798a0..8744e19995aec9cfcf93ce88e53119fce6131c70 100644 (file)
@@ -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));
        }
 }