]> git.mxchange.org Git - friendica.git/commitdiff
New function to replace blank characters
authorMichael <heluecht@pirati.ca>
Mon, 28 Aug 2023 20:24:20 +0000 (20:24 +0000)
committerMichael <heluecht@pirati.ca>
Mon, 28 Aug 2023 20:24:20 +0000 (20:24 +0000)
src/Content/Smilies.php

index 6d07de575c3973d7421d817d5aab0ef12837867a..add6281ec3a14b7650351881efddbcac328bf8e8 100644 (file)
@@ -294,7 +294,7 @@ class Smilies
         */
        public static function isEmojiPost(string $body): bool
        {
-               $conv = html_entity_decode(str_replace([' ', "\n", "\r"], '', $body));
+               $conv = html_entity_decode(preg_replace('#\s#', '', $body));
                // Emojis are always 4 byte Unicode characters
                return (!empty($conv) && (strlen($conv) / mb_strlen($conv) == 4));
        }