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.

This commit is contained in:
Brion Vibber 2007-11-16 23:10:07 +00:00
parent f6c8f40f96
commit 9477ce3a59

View file

@ -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;