From 1b8de0bdf244fc76cc44d2869e5eddd83466023e Mon Sep 17 00:00:00 2001 From: Andrew Garrett Date: Thu, 17 Sep 2009 09:31:16 +0000 Subject: [PATCH] In Xml::encodeJsVar, keep backwards compatibility by encoding empty arrays as empty arrays rather than empty objects. Regression in r56032, reported as bug 20671 --- includes/Xml.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/Xml.php b/includes/Xml.php index c1b56544dd..380c56a778 100644 --- a/includes/Xml.php +++ b/includes/Xml.php @@ -568,7 +568,8 @@ class Xml { } elseif ( is_int( $value ) ) { $s = $value; } elseif ( is_array( $value ) && // Make sure it's not associative. - array_keys($value) === range(0,count($value)-1) + array_keys($value) === range( 0, count($value) - 1 ) || + count($value) == 0 ) { $s = '['; foreach ( $value as $elt ) { -- 2.20.1