r47090 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r47089‎ | r47090 | r47091 >
Date:15:56, 10 February 2009
Author:catrope
Status:deferred
Tags:
Comment:
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.
Modified paths:
  • /trunk/phase3/includes/api/ApiMain.php (modified) (history)
  • /trunk/phase3/includes/api/ApiResult.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiResult.php
@@ -278,11 +278,11 @@
279279 array_walk_recursive($this->mData, array('ApiResult', 'cleanUp_helper'));
280280 }
281281
282 - private static function cleanUp_helper($s)
 282+ private static function cleanUp_helper(&$s)
283283 {
284284 if(!is_string($s))
285 - return $s;
286 - return UtfNormal::cleanUp($s);
 285+ return;
 286+ $s = UtfNormal::cleanUp($s);
287287 }
288288
289289 public function execute() {
Index: trunk/phase3/includes/api/ApiMain.php
@@ -442,7 +442,7 @@
443443 * Print results using the current printer
444444 */
445445 protected function printResult($isError) {
446 - $this->getResult()->cleanupUTF8();
 446+ $this->getResult()->cleanUpUTF8();
447447 $printer = $this->mPrinter;
448448 $printer->profileIn();
449449

Status & tagging log