r56496 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r56495‎ | r56496 | r56497 >
Date:09:31, 17 September 2009
Author:werdna
Status:ok
Tags:
Comment:
In Xml::encodeJsVar, keep backwards compatibility by encoding empty arrays as empty arrays rather than empty objects. Regression in r56032, reported as bug 20671
Modified paths:
  • /trunk/phase3/includes/Xml.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Xml.php
@@ -568,7 +568,8 @@
569569 } elseif ( is_int( $value ) ) {
570570 $s = $value;
571571 } elseif ( is_array( $value ) && // Make sure it's not associative.
572 - array_keys($value) === range(0,count($value)-1)
 572+ array_keys($value) === range( 0, count($value) - 1 ) ||
 573+ count($value) == 0
573574 ) {
574575 $s = '[';
575576 foreach ( $value as $elt ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r56497Merge r56496 (JS variable regression)werdna09:33, 17 September 2009
r56797merged r56490, r56496aaron00:59, 23 September 2009

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r56032Add AJAX category management system. Includes suggestion system, dialogs for ...werdna15:02, 8 September 2009

Status & tagging log