Fix up r45749: do is_string() check in the caller instead
authorRoan Kattouw <catrope@users.mediawiki.org>
Wed, 21 Jan 2009 09:26:48 +0000 (09:26 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Wed, 21 Jan 2009 09:26:48 +0000 (09:26 +0000)
includes/api/ApiResult.php
includes/normal/UtfNormal.php

index 3071015..ec823aa 100644 (file)
@@ -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() {
index 3f08cb4..4f8b129 100644 (file)
@@ -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(