In Xml::encodeJsVar, keep backwards compatibility by encoding empty arrays as empty...
authorAndrew Garrett <werdna@users.mediawiki.org>
Thu, 17 Sep 2009 09:31:16 +0000 (09:31 +0000)
committerAndrew Garrett <werdna@users.mediawiki.org>
Thu, 17 Sep 2009 09:31:16 +0000 (09:31 +0000)
includes/Xml.php

index c1b5654..380c56a 100644 (file)
@@ -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 ) {