From 48f8f3f5cf4c6952076842fb1a59551aeec18faa Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Thu, 26 Feb 2015 22:58:36 +0100 Subject: [PATCH] php5-intl is recommended but not required --- lib/util.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/util.php b/lib/util.php index 9a70d8d44e..e132c587fa 100644 --- a/lib/util.php +++ b/lib/util.php @@ -1141,6 +1141,13 @@ function common_xml_safe_str($str) function common_slugify($str) { + // php5-intl is highly recommended... + if (!function_exists('transliterator_transliterate')) { + $str = preg_replace('/[^\pL\pN]/u', '', $str); + $str = mb_convert_case($str, MB_CASE_LOWER, 'UTF-8'); + $str = substr($str, 0, 64); + return $str; + } $str = transliterator_transliterate( 'Any-Latin;' . // any charset to latin compatible 'NFD;' . // decompose