From 9bff969d959039ecd636864f57f18884c248eddf Mon Sep 17 00:00:00 2001 From: Cyperghost Date: Mon, 9 Dec 2024 13:09:49 +0100 Subject: [PATCH] Also allows numbers in smiley code See https://www.woltlab.com/community/thread/310038-smileyerkennung-scheint-nicht-zu-richtig-zu-funktionieren/ --- wcfsetup/install/files/lib/data/smiley/SmileyCache.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/lib/data/smiley/SmileyCache.class.php b/wcfsetup/install/files/lib/data/smiley/SmileyCache.class.php index 749b0df051..ebe69e5e5a 100644 --- a/wcfsetup/install/files/lib/data/smiley/SmileyCache.class.php +++ b/wcfsetup/install/files/lib/data/smiley/SmileyCache.class.php @@ -166,7 +166,7 @@ class SmileyCache extends SingletonFactory } /** - * Return all smileys that match `:[a-z]+(?:_[a-z]+)*:`. + * Return all smileys that match `:[a-z][a-z0-9]*+(?:_[a-z0-9]+)*:`. * * @return Smiley[] * @since 6.1 @@ -178,7 +178,7 @@ class SmileyCache extends SingletonFactory foreach ($this->getVisibleCategories() as $category) { foreach ($category as $smiley) { foreach ($smiley->smileyCodes as $smileyCode) { - if (\preg_match('~^:[a-z]+(?:_[a-z]+)*:$~', $smileyCode)) { + if (\preg_match('~^:[a-z][a-z0-9]*+(?:_[a-z0-9]+)*:$~', $smileyCode)) { $this->emojis[$smileyCode] = $smiley; } } -- 2.20.1