From ea616bd18051ffcc4fe4e4516af69acd6cb08921 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Wed, 4 Jun 2008 01:57:32 +0000 Subject: [PATCH] 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. --- RELEASE-NOTES | 2 ++ includes/DefaultSettings.php | 5 +++++ includes/SpecialVersion.php | 12 +++++++----- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 480f3e9aac..5ba98eb3ee 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -47,6 +47,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN 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 === diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 35455f8b57..26ec50ba9a 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -948,6 +948,11 @@ $wgDebugDumpSql = false; */ $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 diff --git a/includes/SpecialVersion.php b/includes/SpecialVersion.php index a745949e53..8771fa1cf1 100644 --- a/includes/SpecialVersion.php +++ b/includes/SpecialVersion.php @@ -28,16 +28,18 @@ class SpecialVersion { * main() */ function execute() { - global $wgOut, $wgMessageCache; + global $wgOut, $wgMessageCache, $wgSpecialVersionShowHooks; $wgMessageCache->loadAllMessages(); $wgOut->addHTML( '
' ); - $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( '
' ); } -- 2.20.1