MediaWiki r35842 - Code Review

Jump to: navigation, search
Repository:MediaWiki
Revision:r35841‎ | r35842 (on ViewVC)‎ | r35843 >
Date:01:57, 4 June 2008
Author:tstarling
Status:old
Tags:
Comment:
Disable hooks display in Special:Version by default. It's unnecessarily technical, usually useless, and may cause unintended leakage of information about anti-spam measures in use.
Modified paths:

Diff [purge]

Index: trunk/phase3/includes/DefaultSettings.php
===================================================================
--- trunk/phase3/includes/DefaultSettings.php	(revision 35841)
+++ trunk/phase3/includes/DefaultSettings.php	(revision 35842)
@@ -949,6 +949,11 @@
 $wgDebugLogGroups       = array();
 
 /**
+ * Show the contents of $wgHooks in Special:Version
+ */
+$wgSpecialVersionShowHooks =  false;
+
+/**
  * Whether to show "we're sorry, but there has been a database error" pages.
  * Displaying errors aids in debugging, but may display information useful
  * to an attacker.
Index: trunk/phase3/includes/SpecialVersion.php
===================================================================
--- trunk/phase3/includes/SpecialVersion.php	(revision 35841)
+++ trunk/phase3/includes/SpecialVersion.php	(revision 35842)
@@ -28,16 +28,18 @@
 	 * main()
 	 */
 	function execute() {
-		global $wgOut, $wgMessageCache;
+		global $wgOut, $wgMessageCache, $wgSpecialVersionShowHooks;
 		$wgMessageCache->loadAllMessages();
 
 		$wgOut->addHTML( '<div dir="ltr">' );
-		$wgOut->addWikiText(
+		$text = 
 			$this->MediaWikiCredits() .
 			$this->softwareInformation() .
-			$this->extensionCredits() .
-			$this->wgHooks()
-		);
+			$this->extensionCredits();
+		if  ( $wgSpecialVersionShowHooks ) {
+			$text .= $this->wgHooks();
+		}
+		$wgOut->addWikiText( $text );
 		$wgOut->addHTML( $this->IPInfo() );
 		$wgOut->addHTML( '</div>' );
 	}
Index: trunk/phase3/RELEASE-NOTES
===================================================================
--- trunk/phase3/RELEASE-NOTES	(revision 35841)
+++ trunk/phase3/RELEASE-NOTES	(revision 35842)
@@ -47,6 +47,8 @@
   image page already exists
 * $wgMaximumMovedPages restricts the number of pages that can be moved at once
   (default 100) with the new subpage-move functionality of Special:Movepage
+* Hooks display in Special:Version is now disabled by default, use 
+  $wgSpecialVersionShowHooks = true; to enable it.
 
 === New features in 1.13 ===
 

Status & tagging log

  • 15:27, 12 September 2011 Meno25 (Talk | contribs) changed the status of r35842 [removed: ok added: old]
Personal tools
Namespaces
Variants
Views
Actions
Site
Support
Download
Development
Communication
Toolbox