Issue 8458: Display big emojis

Fixes #8458
This commit is contained in:
Michael 2020-05-17 16:55:54 +00:00
parent db63d1d501
commit d7f0ffdbc1
2 changed files with 13 additions and 1 deletions

View file

@ -1724,7 +1724,15 @@ 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)) {
$conv = html_entity_decode(str_replace([' ', "\n", "\r"], '', $text));
// Emojis are always 4 byte Unicode characters
if (strlen($conv) / mb_strlen($conv) == 4) {
$text = '<span style="font-size: xx-large; line-height: initial;">' . $text . '</span>';
}
}
} }
if (!$for_plaintext) { if (!$for_plaintext) {

View file

@ -103,6 +103,10 @@ return [
// chose "Remember me" when logging in is considered logged out. // chose "Remember me" when logging in is considered logged out.
'auth_cookie_lifetime' => 7, 'auth_cookie_lifetime' => 7,
// big_emojis (Boolean)
// Display "Emoji Only" posts in big.
'big_emojis' => false,
// block_local_dir (Boolean) // block_local_dir (Boolean)
// Deny public access to the local user directory. // Deny public access to the local user directory.
'block_local_dir' => false, 'block_local_dir' => false,