From: Roan Kattouw Date: Wed, 21 Jan 2009 09:26:48 +0000 (+0000) Subject: Fix up r45749: do is_string() check in the caller instead X-Git-Tag: 1.31.0-rc.0~43327 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dcompta/comptes/journal.php?a=commitdiff_plain;h=ad4a03c316f3742ddc5844f7d74f27ff98cb0590;p=lhc%2Fweb%2Fwiklou.git Fix up r45749: do is_string() check in the caller instead --- diff --git a/includes/api/ApiResult.php b/includes/api/ApiResult.php index 307101574b..ec823aa6b8 100644 --- a/includes/api/ApiResult.php +++ b/includes/api/ApiResult.php @@ -192,7 +192,14 @@ class ApiResult extends ApiBase { public function cleanUpUTF8() { $data = & $this->getData(); - array_walk_recursive($data, array('UtfNormal', 'cleanUp')); + array_walk_recursive($data, array('ApiResult', 'cleanUp_helper')); + } + + private static function cleanUp_helper($s) + { + if(!is_string($s)) + return $s; + return UtfNormal::cleanUp($s); } public function execute() { diff --git a/includes/normal/UtfNormal.php b/includes/normal/UtfNormal.php index 3f08cb476a..4f8b12935d 100644 --- a/includes/normal/UtfNormal.php +++ b/includes/normal/UtfNormal.php @@ -72,9 +72,6 @@ class UtfNormal { * @return string a clean, shiny, normalized UTF-8 string */ static function cleanUp( $string ) { - if( !is_string( $string ) ) { - return $string; - } if( NORMALIZE_ICU ) { # We exclude a few chars that ICU would not. $string = preg_replace(