]> Raphaƫl G. Git Repositories - userbundle/blobdiff - Utils/Slugger.php
Switch to new full locale naming
[userbundle] / Utils / Slugger.php
index 9a33e6dca46b6b780f21411e19b9062f46ed421a..8422f2c5715d20aa31b9ce7e764722704151242a 100644 (file)
@@ -106,8 +106,8 @@ class Slugger {
        function slug(string $string): string {
                //Use Transliterator if available
                if (class_exists('Transliterator')) {
-                       $trans = Transliterator::create('Any-Latin; Latin-ASCII; Lower()');
-                       return preg_replace(['/[^a-zA-Z0-9\.]+/', '/(^-+|-+$)/', '/\.[^\.]+$/'], ['-', '', ''], $trans->transliterate($string));
+                       $trans = \Transliterator::create('Any-Latin; Latin-ASCII; Lower()');
+                       return preg_replace(['/[^a-zA-Z0-9]+/', '/(^-+|-+$)/'], ['-', ''], $trans->transliterate($string));
                }
                return preg_replace('/[\/_|+ -]+/', '-', strtolower(trim(preg_replace('/[^a-zA-Z0-9\/_|+ -]/', '', str_replace(['\'', '"'], ' ', iconv('UTF-8', 'ASCII//TRANSLIT', $string))), '-')));
        }