Follow-up r86954: make one centralised call to array_values(), there are more breakag...
authorMax Semenik <maxsem@users.mediawiki.org>
Tue, 26 Apr 2011 19:20:19 +0000 (19:20 +0000)
committerMax Semenik <maxsem@users.mediawiki.org>
Tue, 26 Apr 2011 19:20:19 +0000 (19:20 +0000)
includes/api/ApiParamInfo.php

index ed3b450..26f0398 100644 (file)
@@ -174,6 +174,7 @@ class ApiParamInfo extends ApiBase {
                        if ( isset( $p[ApiBase::PARAM_TYPE] ) ) {
                                $a['type'] = $p[ApiBase::PARAM_TYPE];
                                if ( is_array( $a['type'] ) ) {
+                                       $a['type'] = array_values( $a['type'] ); // to prevent sparse arrays from being serialized to JSON as objects
                                        $result->setIndexedTagName( $a['type'], 't' );
                                }
                        }