Add wfObjectToArray to json_decode to ensure that the return value is an array
authorBryan Tong Minh <btongminh@users.mediawiki.org>
Thu, 10 Mar 2011 12:02:35 +0000 (12:02 +0000)
committerBryan Tong Minh <btongminh@users.mediawiki.org>
Thu, 10 Mar 2011 12:02:35 +0000 (12:02 +0000)
includes/json/FormatJson.php

index f9667f5..26f3762 100644 (file)
@@ -58,7 +58,7 @@ class FormatJson {
                        $jsonDec = $json->decode( $value );
                        return $jsonDec;
                } else {
-                       return json_decode( $value, $assoc );
+                       return wfObjectToArray( json_decode( $value, $assoc ) );
                }
        }