r82091 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r82090‎ | r82091 | r82092 >
Date:23:08, 13 February 2011
Author:brion
Status:ok
Tags:
Comment:
* (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
Modified paths:
  • /trunk/phase3/includes/json/FormatJson.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/json/FormatJson.php
@@ -49,11 +49,11 @@
5050 */
5151 public static function decode( $value, $assoc = false ) {
5252 if ( !function_exists( 'json_decode' ) ) {
53 - $json = new Services_JSON();
 53+ if( $assoc )
 54+ $json = new Services_JSON( SERVICES_JSON_LOOSE_TYPE );
 55+ else
 56+ $json = new Services_JSON();
5457 $jsonDec = $json->decode( $value );
55 - if( $assoc ) {
56 - $jsonDec = wfObjectToArray( $jsonDec );
57 - }
5858 return $jsonDec;
5959 } else {
6060 return json_decode( $value, $assoc );

Follow-up revisions

RevisionCommit summaryAuthorDate
r821511.17wmf1: MFT r78964, r79086, r79087, r79091, r82004, r82025, r82048, r82070,...catrope22:55, 14 February 2011
r82466Follow up r82091, which uses the local file constant SERVICES_JSON_LOOSE_TYPE.platonides16:59, 19 February 2011
r85151MFT: r82000, r82004, r82020, r82025, r82038, r82039, r82048, r82070, r82081, ...demon20:39, 1 April 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r82090* (bug 26250, bug 23817) Fix wfObjectToArray() to descend into arrays; fixes ...brion23:04, 13 February 2011

Status & tagging log