http://www.mediawiki.org/wiki/Special:Code/MediaWiki/75648

Revision: 75648
Author:   btongminh
Date:     2010-10-29 16:19:35 +0000 (Fri, 29 Oct 2010)
Log Message:
-----------
Follow-up r75621: Check for $wgEnableAPI before adding the RSD link to the head

Modified Paths:
--------------
    trunk/phase3/includes/Skin.php

Modified: trunk/phase3/includes/Skin.php
===================================================================
--- trunk/phase3/includes/Skin.php      2010-10-29 16:06:20 UTC (rev 75647)
+++ trunk/phase3/includes/Skin.php      2010-10-29 16:19:35 UTC (rev 75648)
@@ -192,7 +192,7 @@
        }
 
        function initPage( OutputPage $out ) {
-               global $wgFavicon, $wgAppleTouchIcon;
+               global $wgFavicon, $wgAppleTouchIcon, $wgEnableAPI;
 
                wfProfileIn( __METHOD__ );
 
@@ -216,15 +216,17 @@
                        '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 );
 


_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to