From: Cyperghost Date: Mon, 9 Dec 2024 12:09:49 +0000 (+0100) Subject: Also allows numbers in smiley code X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9bff969d959039ecd636864f57f18884c248eddf;p=GitHub%2FWoltLab%2FWCF.git Also allows numbers in smiley code See https://www.woltlab.com/community/thread/310038-smileyerkennung-scheint-nicht-zu-richtig-zu-funktionieren/ --- 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; } }