From 5bf752ee6af92b316b08431bcb633e7a63316723 Mon Sep 17 00:00:00 2001 From: X! Date: Tue, 16 Dec 2008 17:19:05 +0000 Subject: [PATCH] * (bug 16672) Add canonical parameter to meta=siteinfo&siprop=namespaces|namespacealiases. --- RELEASE-NOTES | 1 + includes/api/ApiQuerySiteinfo.php | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 58f313faad..74ce5420e3 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -233,6 +233,7 @@ The following extensions are migrated into MediaWiki 1.14: * (bug 7492) Rights can now be assigned to specific IP addresses and ranges by using $wgAutopromote (new defines: APCOND_ISIP and APCOND_IPINRANGE) * Add a 'change block' link to Special:IPBlockList und Special:Log +* (bug 16672) Add canonical parameter to meta=siteinfo&siprop=namespaces|namespacealiases. === Bug fixes in 1.14 === diff --git a/includes/api/ApiQuerySiteinfo.php b/includes/api/ApiQuerySiteinfo.php index 3610e27d80..c92272aeda 100644 --- a/includes/api/ApiQuerySiteinfo.php +++ b/includes/api/ApiQuerySiteinfo.php @@ -135,8 +135,13 @@ class ApiQuerySiteinfo extends ApiQueryBase { 'id' => $ns ); ApiResult :: setContent( $data[$ns], $title ); - if( MWNamespace::hasSubpages($ns) ) + $canonical = Namespace::getCanonicalName( $ns ); + + if( MWNamespace::hasSubpages( $ns ) ) $data[$ns]['subpages'] = ''; + + if( $canonical ) + $data[$ns]['canonical'] = $canonical; } $this->getResult()->setIndexedTagName( $data, 'ns' ); -- 2.20.1