case 'variables':
$fit = $this->appendVariables( $p );
break;
+ case 'protocols':
+ $fit = $this->appendProtocols( $p );
+ break;
default:
ApiBase::dieDebug( __METHOD__, "Unknown prop=$p" );
}
}
protected function appendGeneralInfo( $property ) {
- global $wgContLang;
+ global $wgContLang,
+ $wgDisableLangConversion,
+ $wgDisableTitleConversion;
$data = array();
$mainPage = Title::newMainPage();
$data['dbtype'] = $GLOBALS['wgDBtype'];
$data['dbversion'] = $this->getDB()->getServerVersion();
+ if ( !$wgDisableLangConversion ) {
+ $data['langconversion'] = '';
+ }
+
+ if ( !$wgDisableTitleConversion ) {
+ $data['titleconversion'] = '';
+ }
+
+ if ( $wgContLang->linkPrefixExtension() ) {
+ $data['linkprefix'] = wfMessage( 'linkprefix' )->inContentLanguage()->text();
+ } else {
+ $data['linkprefix'] = '';
+ }
+
+ $linktrail = $wgContLang->linkTrail();
+ if ( $linktrail ) {
+ $data['linktrail'] = $linktrail;
+ } else {
+ $data['linktrail'] = '';
+ }
+
$git = SpecialVersion::getGitHeadSha1( $GLOBALS['IP'] );
if ( $git ) {
$data['git-hash'] = $git;
);
}
} else {
- list( $host, $lag, $index ) = $lb->getMaxLag();
+ list( , $lag, $index ) = $lb->getMaxLag();
$data[] = array(
'host' => $wgShowHostnames
? $lb->getServerName( $index )
return $this->getResult()->addValue( 'query', $property, $variables );
}
+ public function appendProtocols( $property ) {
+ global $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 ) {
return "<{$item}>";
}
'functionhooks',
'showhooks',
'variables',
+ 'protocols',
)
),
'filteriw' => array(
' functionhooks - Returns a list of parser function hooks',
' showhooks - Returns a list of all subscribed hooks (contents of $wgHooks)',
' variables - Returns a list of variable IDs',
+ ' protocols - Returns a list of protocols that are allowed in external links.',
),
'filteriw' => 'Return only local or only nonlocal entries of the interwiki map',
'showalldb' => 'List all database servers, not just the one lagging the most',