Also allows numbers in smiley code
authorCyperghost <olaf_schmitz_1@t-online.de>
Mon, 9 Dec 2024 12:09:49 +0000 (13:09 +0100)
committerCyperghost <olaf_schmitz_1@t-online.de>
Mon, 9 Dec 2024 12:09:49 +0000 (13:09 +0100)
See https://www.woltlab.com/community/thread/310038-smileyerkennung-scheint-nicht-zu-richtig-zu-funktionieren/

wcfsetup/install/files/lib/data/smiley/SmileyCache.class.php

index 749b0df0513bd03a34ed6dff57fc9ebd4382e351..ebe69e5e5a7ba07c946bcf83b41be93ee3b734ea 100644 (file)
@@ -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;
                         }
                     }