It's no problem to use empty(), as long as you return $str rather than an empty string.
authorRoan Kattouw <catrope@users.mediawiki.org>
Tue, 13 Nov 2007 15:07:54 +0000 (15:07 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Tue, 13 Nov 2007 15:07:54 +0000 (15:07 +0000)
languages/Language.php

index b5303ed..9a3e798 100644 (file)
@@ -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]);