Follow-up r75621: Check for $wgEnableAPI before adding the RSD link to the head
authorBryan Tong Minh <btongminh@users.mediawiki.org>
Fri, 29 Oct 2010 16:19:35 +0000 (16:19 +0000)
committerBryan Tong Minh <btongminh@users.mediawiki.org>
Fri, 29 Oct 2010 16:19:35 +0000 (16:19 +0000)
includes/Skin.php

index 0b44a67..034fa23 100644 (file)
@@ -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 );