From f6307768aa823bfb0aae778395584f41e524bdcf Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Tue, 10 Feb 2009 15:56:34 +0000 Subject: [PATCH] API: Make UTF-8 cleanup actually work; it was broken from the beginning. Apparently I expected array_walk to behave like array_map, which is not the case. --- includes/api/ApiMain.php | 2 +- includes/api/ApiResult.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/api/ApiMain.php b/includes/api/ApiMain.php index 7f3b4a73fb..a2b981430a 100644 --- a/includes/api/ApiMain.php +++ b/includes/api/ApiMain.php @@ -442,7 +442,7 @@ class ApiMain extends ApiBase { * Print results using the current printer */ protected function printResult($isError) { - $this->getResult()->cleanupUTF8(); + $this->getResult()->cleanUpUTF8(); $printer = $this->mPrinter; $printer->profileIn(); diff --git a/includes/api/ApiResult.php b/includes/api/ApiResult.php index 86a8d1db19..90156bdaa3 100644 --- a/includes/api/ApiResult.php +++ b/includes/api/ApiResult.php @@ -278,11 +278,11 @@ class ApiResult extends ApiBase { array_walk_recursive($this->mData, array('ApiResult', 'cleanUp_helper')); } - private static function cleanUp_helper($s) + private static function cleanUp_helper(&$s) { if(!is_string($s)) - return $s; - return UtfNormal::cleanUp($s); + return; + $s = UtfNormal::cleanUp($s); } public function execute() { -- 2.20.1