From 7e83c69fa3bf211f54d10e847ed53b591c762139 Mon Sep 17 00:00:00 2001 From: Alex Monk Date: Mon, 18 Feb 2013 20:57:00 +0000 Subject: [PATCH] (bug 45130) Fix siprop=protocols in XML format Change-Id: I2362be19f1e8f759e574d85ed210978c0fbd53a3 --- includes/api/ApiQuerySiteinfo.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/includes/api/ApiQuerySiteinfo.php b/includes/api/ApiQuerySiteinfo.php index 593d6e71b3..624711a61f 100644 --- a/includes/api/ApiQuerySiteinfo.php +++ b/includes/api/ApiQuerySiteinfo.php @@ -554,8 +554,10 @@ class ApiQuerySiteinfo extends ApiQueryBase { public function appendProtocols( $property ) { global $wgUrlProtocols; - $this->getResult()->setIndexedTagName( $wgUrlProtocols, 'p' ); - return $this->getResult()->addValue( 'query', $property, $wgUrlProtocols ); + // Make a copy of the global so we don't try to set the _element key of it - bug 45130 + $protocols = array_values( $wgUrlProtocols ); + $this->getResult()->setIndexedTagName( $protocols, 'p' ); + return $this->getResult()->addValue( 'query', $property, $protocols ); } private function formatParserTags( $item ) { -- 2.20.1