From: Brion Vibber Date: Fri, 16 Nov 2007 23:10:07 +0000 (+0000) Subject: Instead of giving weird-ass results when an array is passed to Language::lcfirst... X-Git-Tag: 1.31.0-rc.0~50845 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=9477ce3a5927295505b2b19ec8ffb2b19d0431b7;p=lhc%2Fweb%2Fwiklou.git Instead of giving weird-ass results when an array is passed to Language::lcfirst(), only use our clever optimization if it is a string. Array will spit out annoying notices as before so you can tell what you did wrong. --- diff --git a/languages/Language.php b/languages/Language.php index fda406a8c9..0fda0db4d4 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -1202,7 +1202,7 @@ class Language { function lcfirst( $str ) { if ( empty($str) ) return $str; - if ( ord($str[0]) < 128 ) { + if ( is_string( $str ) && ord($str[0]) < 128 ) { // editing string in place = cool $str[0]=strtolower($str[0]); return $str;