From: Roan Kattouw Date: Sun, 24 Jan 2010 12:11:18 +0000 (+0000) Subject: API: Support key-params arrays in 'descriptionmsg' in meta=siteinfo&siprop=extensions X-Git-Tag: 1.31.0-rc.0~38117 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=e7aeb3f91f6a27a61c8df57bc075f87c4c29b071;p=lhc%2Fweb%2Fwiklou.git API: Support key-params arrays in 'descriptionmsg' in meta=siteinfo&siprop=extensions --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 03b34ee98b..b091c52c09 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -803,6 +803,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 22241) Quick edit is still using the deprecated watch parameter (API: Setting default for watch/unwatch wrongly set) * (bug 22245) blfilterredirect=nonredirects in blredirect mode wrongly filtering * (bug 22248) Output extension URLs in meta=siteinfo&siprop=extensions +* Support key-params arrays in 'descriptionmsg' in meta=siteinfo&siprop=extensions === Languages updated in 1.16 === diff --git a/includes/api/ApiQuerySiteinfo.php b/includes/api/ApiQuerySiteinfo.php index 1f0fbab7d2..415739e0da 100644 --- a/includes/api/ApiQuerySiteinfo.php +++ b/includes/api/ApiQuerySiteinfo.php @@ -359,14 +359,22 @@ class ApiQuerySiteinfo extends ApiQueryBase { $ret['name'] = $ext['name']; if ( isset( $ext['description'] ) ) $ret['description'] = $ext['description']; - if ( isset( $ext['descriptionmsg'] ) ) - $ret['descriptionmsg'] = $ext['descriptionmsg']; + if ( isset( $ext['descriptionmsg'] ) ) { + // Can be a string or array( key, param1, param2, ... ) + if ( is_array( $ext['descriptionmsg'] ) ) { + $ret['descriptionmsg'] = $ext['descriptionmsg'][0]; + $ret['descriptionmsgparams'] = array_slice( $ext['descriptionmsg'], 1 ); + $this->getResult()->setIndexedTagName( $ret['descriptionmsgparams'], 'param' ); + } else { + $ret['descriptionmsg'] = $ext['descriptionmsg']; + } + } if ( isset( $ext['author'] ) ) { $ret['author'] = is_array( $ext['author'] ) ? implode( ', ', $ext['author' ] ) : $ext['author']; } if ( isset( $ext['url'] ) ) { - $ret['url'] = $ext['url']; + $ret['url'] = $ext['url']; } if ( isset( $ext['version'] ) ) { $ret['version'] = $ext['version'];