From ad4a03c316f3742ddc5844f7d74f27ff98cb0590 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Wed, 21 Jan 2009 09:26:48 +0000 Subject: [PATCH] Fix up r45749: do is_string() check in the caller instead --- includes/api/ApiResult.php | 9 ++++++++- includes/normal/UtfNormal.php | 3 --- 2 files changed, 8 insertions(+), 4 deletions(-) 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( -- 2.20.1