From 85eec5b399735587ef839cd1773bcf4bcf2eb7fc Mon Sep 17 00:00:00 2001 From: Bryan Tong Minh Date: Fri, 29 Oct 2010 16:19:35 +0000 Subject: [PATCH] Follow-up r75621: Check for $wgEnableAPI before adding the RSD link to the head --- includes/Skin.php | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/includes/Skin.php b/includes/Skin.php index 0b44a6768b..034fa239ba 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -192,7 +192,7 @@ class Skin extends Linker { } function initPage( OutputPage $out ) { - global $wgFavicon, $wgAppleTouchIcon; + global $wgFavicon, $wgAppleTouchIcon, $wgEnableAPI; wfProfileIn( __METHOD__ ); @@ -216,15 +216,17 @@ class Skin extends Linker { '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 ); -- 2.20.1