]> Raphaël G. Git Repositories - userbundle/commitdiff
Remove dot and extension cleaning
authorRaphaël Gertz <git@rapsys.eu>
Sun, 29 Nov 2020 07:37:04 +0000 (08:37 +0100)
committerRaphaël Gertz <git@rapsys.eu>
Sun, 29 Nov 2020 07:37:04 +0000 (08:37 +0100)
Utils/Slugger.php

index 9a33e6dca46b6b780f21411e19b9062f46ed421a..e781fa5c95e3c55e7b9a4605a3ba386053b4765e 100644 (file)
@@ -107,7 +107,7 @@ class Slugger {
                //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));
+                       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))), '-')));
        }