diff options
author | Thomas Lange <code@nerdmind.de> | 2018-09-09 21:40:56 +0200 |
---|---|---|
committer | Thomas Lange <code@nerdmind.de> | 2018-09-09 21:51:30 +0200 |
commit | 2870bef5d11d01f90929a0a5e67ff605e68d9ded (patch) | |
tree | 7c1d4efd3c342a913269ca41e1ab14a5014b3cf2 /core | |
parent | 3977b46ed4430644468bce1edd3344975b4ff86e (diff) | |
download | blog-2870bef5d11d01f90929a0a5e67ff605e68d9ded.tar.gz blog-2870bef5d11d01f90929a0a5e67ff605e68d9ded.tar.xz blog-2870bef5d11d01f90929a0a5e67ff605e68d9ded.zip |
Add function "getUnicodeEmoticons"
This function returns an associative array with the UTF-8 encoded emoticon character as key and the corresponding explanation text as value.
Diffstat (limited to 'core')
-rw-r--r-- | core/functions.php | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/core/functions.php b/core/functions.php index ad63334..7bddb5b 100644 --- a/core/functions.php +++ b/core/functions.php @@ -193,6 +193,30 @@ function parseEmoticons($string): string { } #=============================================================================== +# Get unicode emoticons with their corresponding explanation +#=============================================================================== +function getUnicodeEmoticons(): array { + $Language = Application::getLanguage(); + + return [ + html_entity_decode('😊') => $Language->text('emoticon_1F60A'), + html_entity_decode('😞') => $Language->text('emoticon_1F61E'), + html_entity_decode('😃') => $Language->text('emoticon_1F603'), + html_entity_decode('😛') => $Language->text('emoticon_1F61B'), + html_entity_decode('😲') => $Language->text('emoticon_1F632'), + html_entity_decode('😉') => $Language->text('emoticon_1F609'), + html_entity_decode('😢') => $Language->text('emoticon_1F622'), + html_entity_decode('😐') => $Language->text('emoticon_1F610'), + html_entity_decode('😵') => $Language->text('emoticon_1F635'), + html_entity_decode('😒') => $Language->text('emoticon_1F612'), + html_entity_decode('😎') => $Language->text('emoticon_1F60E'), + html_entity_decode('😟') => $Language->text('emoticon_1F61F'), + html_entity_decode('😂') => $Language->text('emoticon_1F602'), + html_entity_decode('😄') => $Language->text('emoticon_1F604'), + ]; +} + +#=============================================================================== # Wrapper function for htmlspecialchars() #=============================================================================== function escapeHTML($string): string { |