aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Lange <code@nerdmind.de>2018-09-09 21:40:56 +0200
committerThomas Lange <code@nerdmind.de>2018-09-09 21:51:30 +0200
commit2870bef5d11d01f90929a0a5e67ff605e68d9ded (patch)
tree7c1d4efd3c342a913269ca41e1ab14a5014b3cf2
parent3977b46ed4430644468bce1edd3344975b4ff86e (diff)
downloadblog-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.
-rw-r--r--core/functions.php24
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('&#x1F60A;') => $Language->text('emoticon_1F60A'),
+ html_entity_decode('&#x1F61E;') => $Language->text('emoticon_1F61E'),
+ html_entity_decode('&#x1F603;') => $Language->text('emoticon_1F603'),
+ html_entity_decode('&#x1F61B;') => $Language->text('emoticon_1F61B'),
+ html_entity_decode('&#x1F632;') => $Language->text('emoticon_1F632'),
+ html_entity_decode('&#x1F609;') => $Language->text('emoticon_1F609'),
+ html_entity_decode('&#x1F622;') => $Language->text('emoticon_1F622'),
+ html_entity_decode('&#x1F610;') => $Language->text('emoticon_1F610'),
+ html_entity_decode('&#x1F635;') => $Language->text('emoticon_1F635'),
+ html_entity_decode('&#x1F612;') => $Language->text('emoticon_1F612'),
+ html_entity_decode('&#x1F60E;') => $Language->text('emoticon_1F60E'),
+ html_entity_decode('&#x1F61F;') => $Language->text('emoticon_1F61F'),
+ html_entity_decode('&#x1F602;') => $Language->text('emoticon_1F602'),
+ html_entity_decode('&#x1F604;') => $Language->text('emoticon_1F604'),
+ ];
+}
+
+#===============================================================================
# Wrapper function for htmlspecialchars()
#===============================================================================
function escapeHTML($string): string {