aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorThomas Lange <code@nerdmind.de>2021-07-16 23:03:57 +0200
committerThomas Lange <code@nerdmind.de>2021-07-16 23:03:57 +0200
commitea00b92232d2efb121e55825aef7dfa28b97349e (patch)
tree12612808dc912d8ed6c1af8b71992c0fb981e7f3 /core
parent01cbd757d69668b39c1b072b0449b77e6e2bee8d (diff)
downloadblog-ea00b92232d2efb121e55825aef7dfa28b97349e.tar.gz
blog-ea00b92232d2efb121e55825aef7dfa28b97349e.tar.xz
blog-ea00b92232d2efb121e55825aef7dfa28b97349e.zip
Drop support for parsing ASCII emoticons
This commit drops support for parsing plain text ASCII emoticons like ":)" or ":P" to its unicode equivalent. Please use unicode emoticons directly (like those already proposed in the admin form templates).
Diffstat (limited to 'core')
-rw-r--r--core/functions.php39
1 files changed, 0 insertions, 39 deletions
diff --git a/core/functions.php b/core/functions.php
index ffcb488..a9d103e 100644
--- a/core/functions.php
+++ b/core/functions.php
@@ -213,7 +213,6 @@ function parseEntityContent(EntityInterface $Entity): string {
if(Application::get("$prefix.EMOTICONS")) {
$text = parseUnicodeEmoticons($text);
- $text = parseEmoticons($text);
}
return $Parsedown->text($text);
@@ -280,44 +279,6 @@ function parseDatetime($datetime, $format): string {
}
#===============================================================================
-# Get emoticons with unicode characters and description
-#===============================================================================
-function getEmoticons(): array {
- $Language = Application::getLanguage();
-
- return [
- ':)' => ['&#x1F60A;', $Language->text('emoticon_1F60A')],
- ':(' => ['&#x1F61E;', $Language->text('emoticon_1F61E')],
- ':D' => ['&#x1F603;', $Language->text('emoticon_1F603')],
- ':P' => ['&#x1F61B;', $Language->text('emoticon_1F61B')],
- ':O' => ['&#x1F632;', $Language->text('emoticon_1F632')],
- ';)' => ['&#x1F609;', $Language->text('emoticon_1F609')],
- ';(' => ['&#x1F622;', $Language->text('emoticon_1F622')],
- ':|' => ['&#x1F610;', $Language->text('emoticon_1F610')],
- ':X' => ['&#x1F635;', $Language->text('emoticon_1F635')],
- ':/' => ['&#x1F612;', $Language->text('emoticon_1F612')],
- '8)' => ['&#x1F60E;', $Language->text('emoticon_1F60E')],
- ':S' => ['&#x1F61F;', $Language->text('emoticon_1F61F')],
- 'xD' => ['&#x1F602;', $Language->text('emoticon_1F602')],
- '^^' => ['&#x1F604;', $Language->text('emoticon_1F604')],
- ];
-}
-
-#===============================================================================
-# Parse emoticons to HTML encoded unicode characters
-#===============================================================================
-function parseEmoticons($string): string {
- foreach(getEmoticons() as $emoticon => $data) {
- $pattern = '#(^|\s)'.preg_quote($emoticon).'#';
- $replace = "\\1<span title=\"{$data[1]}\">{$data[0]}</span>";
-
- $string = preg_replace($pattern, $replace, $string);
- }
-
- return $string;
-}
-
-#===============================================================================
# Get unicode emoticons with their corresponding explanation
#===============================================================================
function getUnicodeEmoticons(): array {