aboutsummaryrefslogtreecommitdiffstats
path: root/includes/json
diff options
context:
space:
mode:
authorBrion Vibber <brion@users.mediawiki.org>2011-02-13 23:08:28 +0000
committerBrion Vibber <brion@users.mediawiki.org>2011-02-13 23:08:28 +0000
commit8982ac25b753646c20bd0ac8f18c26fd7b46afa9 (patch)
tree04a0cb8fefaa1d515826c2a13a104bbdbade1973 /includes/json
parent7d2049c7e3de4932ebb70c8d90d30c5131a3e18d (diff)
downloadmediawikicore-8982ac25b753646c20bd0ac8f18c26fd7b46afa9.tar.gz
mediawikicore-8982ac25b753646c20bd0ac8f18c26fd7b46afa9.zip
* (bug 23817, bug 26250) User Service_JSON's native associative array mode in FormatJson::decode(), bypassing wfObjectToArray (which is also fixed)
Patches from Tim Yates on https://bugzilla.wikimedia.org/show_bug.cgi?id=23817
Notes
Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/82091
Diffstat (limited to 'includes/json')
-rw-r--r--includes/json/FormatJson.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/includes/json/FormatJson.php b/includes/json/FormatJson.php
index 126531419a24..04024f8d54c7 100644
--- a/includes/json/FormatJson.php
+++ b/includes/json/FormatJson.php
@@ -49,11 +49,11 @@ class FormatJson {
*/
public static function decode( $value, $assoc = false ) {
if ( !function_exists( 'json_decode' ) ) {
- $json = new Services_JSON();
+ if( $assoc )
+ $json = new Services_JSON( SERVICES_JSON_LOOSE_TYPE );
+ else
+ $json = new Services_JSON();
$jsonDec = $json->decode( $value );
- if( $assoc ) {
- $jsonDec = wfObjectToArray( $jsonDec );
- }
return $jsonDec;
} else {
return json_decode( $value, $assoc );