From: Roan Kattouw Date: Tue, 13 Nov 2007 15:07:54 +0000 (+0000) Subject: It's no problem to use empty(), as long as you return $str rather than an empty string. X-Git-Tag: 1.31.0-rc.0~50883 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22config_fonctions%22%2C%20%22image_process=%24process%22%29%20.%20%22?a=commitdiff_plain;h=9a9349944b03db46f630f1979e0ff5e84de8fea1;p=lhc%2Fweb%2Fwiklou.git It's no problem to use empty(), as long as you return $str rather than an empty string. --- diff --git a/languages/Language.php b/languages/Language.php index b5303ed893..9a3e79815a 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -931,7 +931,7 @@ class Language { } function ucfirst( $str ) { - if ( $str === '' ) return ""; + if ( empty($str) ) return $str; if ( ord($str[0]) < 128 ) return ucfirst($str); else return self::uc($str,true); // fall back to more complex logic in case of multibyte strings } @@ -963,7 +963,7 @@ class Language { } function lcfirst( $str ) { - if ( $str === '' ) return ""; + if ( empty($str) ) return $str; if ( ord($str[0]) < 128 ) { // editing string in place = cool $str[0]=strtolower($str[0]);