Skip to content
Extraits de code Groupes Projets
Valider 2d597d6d rédigé par b_b's avatar b_b
Parcourir les fichiers

ajout d'une fonction spip_strtolower pour gérer strtolower en utf8, cf #3624

parent 9e9028bb
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -100,6 +100,7 @@ function init_mb_string() {
and function_exists('mb_detect_order')
and function_exists('mb_substr')
and function_exists('mb_strlen')
and function_exists('mb_strtolower')
and function_exists('mb_encode_mimeheader')
and function_exists('mb_encode_numericentity')
and function_exists('mb_decode_numericentity')
......@@ -1157,6 +1158,29 @@ function spip_ucfirst($c) {
return $lettre1 . spip_substr($c, 1);
}
/**
* Passe une chaîne utf-8 en minuscules
*
* Version utf-8 de strtolower
*
* @param string $c
* La chaîne à transformer
* @return string
* La chaîne en minuscules
*/
function spip_strtolower($c) {
// Si ce n'est pas utf-8, utiliser strtolower
if ($GLOBALS['meta']['charset'] != 'utf-8') {
return strtolower($c);
}
// Si on n'a pas mb_* on utilise strtolower
if (!init_mb_string()) {
return strtolower($c);
}
return mb_strtolower($c);
}
/**
* Retourne la longueur d'une chaîne utf-8
*
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter