From: Domas Mituzas Date: Mon, 12 Nov 2007 22:45:48 +0000 (+0000) Subject: do nothing for empty strings... how can you upper-case the void? X-Git-Tag: 1.31.0-rc.0~50898 X-Git-Url: http://git.cyclocoop.org/%22.%24h.%22?a=commitdiff_plain;h=c30a821b7a0a309dd6cd74013d16d215c8876d73;p=lhc%2Fweb%2Fwiklou.git do nothing for empty strings... how can you upper-case the void? --- diff --git a/languages/Language.php b/languages/Language.php index bbdbbc5b64..a91ce2e0df 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -931,6 +931,7 @@ class Language { } function ucfirst( $str ) { + if ($str == "") return ""; 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 } @@ -962,6 +963,7 @@ class Language { } function lcfirst( $str ) { + if ($str == "") return ""; if ( ord($str[0]) < 128 ) { // editing string in place = cool $str[0]=strtolower($str[0]);