From 848c335371eeac540c48ff82fa737f9c12b472d1 Mon Sep 17 00:00:00 2001 From: "This, that and the other" Date: Sun, 22 Jun 2014 15:26:28 +1000 Subject: [PATCH] Expose $wgLocalInterwikis via the API This will hopefully be useful to Parsoid. Bug: 66709 Change-Id: I67d789172d4c6b786ed781f80e513692b3ae4119 --- includes/api/ApiQuerySiteinfo.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/includes/api/ApiQuerySiteinfo.php b/includes/api/ApiQuerySiteinfo.php index a420b37df0..aacf091756 100644 --- a/includes/api/ApiQuerySiteinfo.php +++ b/includes/api/ApiQuerySiteinfo.php @@ -385,6 +385,7 @@ class ApiQuerySiteinfo extends ApiQueryBase { $getPrefixes = Interwiki::getAllPrefixes( $local ); $extraLangPrefixes = $this->getConfig()->get( 'ExtraInterlanguageLinkPrefixes' ); + $localInterwikis = $this->getConfig()->get( 'LocalInterwikis' ); $data = array(); foreach ( $getPrefixes as $row ) { @@ -401,6 +402,9 @@ class ApiQuerySiteinfo extends ApiQueryBase { if ( isset( $langNames[$prefix] ) ) { $val['language'] = $langNames[$prefix]; } + if ( in_array( $prefix, $localInterwikis ) ) { + $val['localinterwiki'] = ''; + } if ( in_array( $prefix, $extraLangPrefixes ) ) { $val['extralanglink'] = ''; -- 2.20.1