From 9685ab92c9a76189112a809478b2a0ca24dfe8d8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Gertz?= Date: Wed, 28 Jul 2021 08:16:38 +0200 Subject: [PATCH 1/1] Use Transliterator from root namespace --- Utils/Slugger.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Utils/Slugger.php b/Utils/Slugger.php index e781fa5..8422f2c 100644 --- a/Utils/Slugger.php +++ b/Utils/Slugger.php @@ -106,7 +106,7 @@ class Slugger { function slug(string $string): string { //Use Transliterator if available if (class_exists('Transliterator')) { - $trans = Transliterator::create('Any-Latin; Latin-ASCII; Lower()'); + $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))), '-'))); -- 2.41.1