From 6db4486e7414f3cb2335b56455debbaa86175930 Mon Sep 17 00:00:00 2001 From: Ambroise Maupate Date: Tue, 2 Jul 2024 22:40:57 +0200 Subject: [PATCH] fix: `StringHandler::variablize` method with non-alphanum characters --- lib/Models/src/Utils/StringHandler.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Models/src/Utils/StringHandler.php b/lib/Models/src/Utils/StringHandler.php index f2f632b7..323e8185 100644 --- a/lib/Models/src/Utils/StringHandler.php +++ b/lib/Models/src/Utils/StringHandler.php @@ -99,6 +99,7 @@ public static function variablize(?string $string): string return (new UnicodeString($string)) ->ascii() + ->replaceMatches('#([^a-zA-Z0-9]+)#', '_') ->snake() ->lower() ->trim('-')