From: Daniel Karbach Date: Thu, 9 May 2024 18:09:58 +0000 (+0200) Subject: fix number and space normalization X-Git-Url: https://git.localhorst.tv/?a=commitdiff_plain;ds=inline;h=e1e352a985c2da1cc0e4ad4716244261445a2604;p=alttp.git fix number and space normalization --- diff --git a/app/Models/ChatLib.php b/app/Models/ChatLib.php index ea16a2b..f4ab93f 100644 --- a/app/Models/ChatLib.php +++ b/app/Models/ChatLib.php @@ -164,8 +164,8 @@ class ChatLib { $str = ''; foreach ($tokens as $token) { $replaced = preg_replace('/\d+/u', '0', $token); - $replaced = preg_replace('/\s+/u', ' ', $token); - $replaced = preg_replace('/(.)\1{2,}/u', '$1$1', $token); + $replaced = preg_replace('/\s+/u', ' ', $replaced); + $replaced = preg_replace('/(.)\1{2,}/u', '$1$1', $replaced); $replaced = strtolower($replaced); foreach ($this->aliases as $canonical => $variants) { if (in_array($replaced, $variants)) {