only transliterate if the function exists
Cette révision appartient à :
Parent
695d2db311
révision
0966f90b2c
|
@ -224,9 +224,12 @@ class DauxHelper
|
||||||
public static function slug($title)
|
public static function slug($title)
|
||||||
{
|
{
|
||||||
// Convert to ASCII
|
// Convert to ASCII
|
||||||
$title = transliterator_transliterate("Any-Latin; NFD; [:Nonspacing Mark:] Remove; NFC;", $title);
|
if (function_exists("transliterator_transliterate")) {
|
||||||
|
$title = transliterator_transliterate("Any-Latin; NFD; [:Nonspacing Mark:] Remove; NFC;", $title);
|
||||||
|
}
|
||||||
|
|
||||||
$title = iconv("utf-8", "ASCII//TRANSLIT//IGNORE", $title);
|
$title = iconv("utf-8", "ASCII//TRANSLIT//IGNORE", $title);
|
||||||
|
|
||||||
// Remove unsupported characters
|
// Remove unsupported characters
|
||||||
$title = preg_replace('/[^\x20-\x7E]/u', '', $title);
|
$title = preg_replace('/[^\x20-\x7E]/u', '', $title);
|
||||||
|
|
||||||
|
|
Chargement…
Référencer dans un nouveau ticket