r35842 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r35841‎ | r35842 | 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:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/SpecialVersion.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/DefaultSettings.php
@@ -949,6 +949,11 @@
950950 $wgDebugLogGroups = array();
951951
952952 /**
 953+ * Show the contents of $wgHooks in Special:Version
 954+ */
 955+$wgSpecialVersionShowHooks = false;
 956+
 957+/**
953958 * Whether to show "we're sorry, but there has been a database error" pages.
954959 * Displaying errors aids in debugging, but may display information useful
955960 * to an attacker.
Index: trunk/phase3/includes/SpecialVersion.php
@@ -28,16 +28,18 @@
2929 * main()
3030 */
3131 function execute() {
32 - global $wgOut, $wgMessageCache;
 32+ global $wgOut, $wgMessageCache, $wgSpecialVersionShowHooks;
3333 $wgMessageCache->loadAllMessages();
3434
3535 $wgOut->addHTML( '<div dir="ltr">' );
36 - $wgOut->addWikiText(
 36+ $text =
3737 $this->MediaWikiCredits() .
3838 $this->softwareInformation() .
39 - $this->extensionCredits() .
40 - $this->wgHooks()
41 - );
 39+ $this->extensionCredits();
 40+ if ( $wgSpecialVersionShowHooks ) {
 41+ $text .= $this->wgHooks();
 42+ }
 43+ $wgOut->addWikiText( $text );
4244 $wgOut->addHTML( $this->IPInfo() );
4345 $wgOut->addHTML( '</div>' );
4446 }
Index: trunk/phase3/RELEASE-NOTES
@@ -47,6 +47,8 @@
4848 image page already exists
4949 * $wgMaximumMovedPages restricts the number of pages that can be moved at once
5050 (default 100) with the new subpage-move functionality of Special:Movepage
 51+* Hooks display in Special:Version is now disabled by default, use
 52+ $wgSpecialVersionShowHooks = true; to enable it.
5153
5254 === New features in 1.13 ===
5355

Status & tagging log