}
function initPage( OutputPage $out ) {
- global $wgFavicon, $wgAppleTouchIcon;
+ global $wgFavicon, $wgAppleTouchIcon, $wgEnableAPI;
wfProfileIn( __METHOD__ );
'title' => wfMsgForContent( 'opensearch-desc' ),
) );
- # Real Simple Discovery link, provides auto-discovery information
- # for the MediaWiki API (and potentially additional custom API
- # support such as WordPress or Twitter-compatible APIs for a
- # blogging extension, etc)
- $out->addLink( array(
- 'rel' => 'EditURI',
- 'type' => 'application/rsd+xml',
- 'href' => wfExpandUrl( wfAppendQuery( wfScript( 'api' ), array( 'action' => 'rsd' ) ) ),
- ) );
+ if ( $wgEnableAPI ) {
+ # Real Simple Discovery link, provides auto-discovery information
+ # for the MediaWiki API (and potentially additional custom API
+ # support such as WordPress or Twitter-compatible APIs for a
+ # blogging extension, etc)
+ $out->addLink( array(
+ 'rel' => 'EditURI',
+ 'type' => 'application/rsd+xml',
+ 'href' => wfExpandUrl( wfAppendQuery( wfScript( 'api' ), array( 'action' => 'rsd' ) ) ),
+ ) );
+ }
$this->addMetadataLinks( $out );