From: Roan Kattouw Date: Tue, 10 Feb 2009 15:56:34 +0000 (+0000) Subject: API: Make UTF-8 cleanup actually work; it was broken from the beginning. Apparently... X-Git-Tag: 1.31.0-rc.0~42946 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/journal.php?a=commitdiff_plain;h=f6307768aa823bfb0aae778395584f41e524bdcf;p=lhc%2Fweb%2Fwiklou.git 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. --- 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() {