Merge pull request #8655 from annando/issue-8458-2

Issue 8458-2: Now all unicode emojis should work
This commit is contained in:
Hypolite Petovan 2020-05-17 21:42:34 -04:00 committed by GitHub
commit d0e9fdab5e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1724,16 +1724,16 @@ class BBCode
// Replace non graphical smilies for external posts // Replace non graphical smilies for external posts
if (!$nosmile && !$for_plaintext) { if (!$nosmile && !$for_plaintext) {
$oldtext = $text;
$text = Smilies::replace($text); $text = Smilies::replace($text);
if (DI::config()->get('system', 'big_emojis') && ($simple_html != self::DIASPORA) && ($oldtext != $text)) { }
if (DI::config()->get('system', 'big_emojis') && ($simple_html != self::DIASPORA)) {
$conv = html_entity_decode(str_replace([' ', "\n", "\r"], '', $text)); $conv = html_entity_decode(str_replace([' ', "\n", "\r"], '', $text));
// Emojis are always 4 byte Unicode characters // Emojis are always 4 byte Unicode characters
if (strlen($conv) / mb_strlen($conv) == 4) { if (strlen($conv) / mb_strlen($conv) == 4) {
$text = '<span style="font-size: xx-large; line-height: initial;">' . $text . '</span>'; $text = '<span style="font-size: xx-large; line-height: initial;">' . $text . '</span>';
} }
} }
}
if (!$for_plaintext) { if (!$for_plaintext) {
if (in_array($simple_html, [self::OSTATUS, self::ACTIVITYPUB])) { if (in_array($simple_html, [self::OSTATUS, self::ACTIVITYPUB])) {