API: Make UTF-8 cleanup actually work; it was broken from the beginning. Apparently...
authorRoan Kattouw <catrope@users.mediawiki.org>
Tue, 10 Feb 2009 15:56:34 +0000 (15:56 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Tue, 10 Feb 2009 15:56:34 +0000 (15:56 +0000)
includes/api/ApiMain.php
includes/api/ApiResult.php

index 7f3b4a7..a2b9814 100644 (file)
@@ -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();
 
index 86a8d1d..90156bd 100644 (file)
@@ -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() {