From: This, that and the other Date: Sun, 22 Jun 2014 05:26:28 +0000 (+1000) Subject: Expose $wgLocalInterwikis via the API X-Git-Tag: 1.31.0-rc.0~15290^2 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/ajouter.php?a=commitdiff_plain;h=848c335371eeac540c48ff82fa737f9c12b472d1;p=lhc%2Fweb%2Fwiklou.git Expose $wgLocalInterwikis via the API This will hopefully be useful to Parsoid. Bug: 66709 Change-Id: I67d789172d4c6b786ed781f80e513692b3ae4119 --- 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'] = '';