From: Andrew Garrett Date: Thu, 17 Sep 2009 09:31:16 +0000 (+0000) Subject: In Xml::encodeJsVar, keep backwards compatibility by encoding empty arrays as empty... X-Git-Tag: 1.31.0-rc.0~39687 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/operations/recherche.php?a=commitdiff_plain;h=1b8de0bdf244fc76cc44d2869e5eddd83466023e;p=lhc%2Fweb%2Fwiklou.git In Xml::encodeJsVar, keep backwards compatibility by encoding empty arrays as empty arrays rather than empty objects. Regression in r56032, reported as bug 20671 --- 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 ) {