r80147 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80146‎ | r80147 | r80148 >
Date:01:13, 13 January 2011
Author:kaldari
Status:deferred
Tags:
Comment:
preventing misuse
Modified paths:
  • /trunk/extensions/CentralNotice/CentralNotice.php (modified) (history)
  • /trunk/extensions/CentralNotice/SpecialHideBanners.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralNotice/CentralNotice.php
@@ -64,6 +64,10 @@
6565 // This setting is currently shared with CentralAuth extension.
6666 $wgCentralAuthCookieDomain = '';
6767
 68+// Enable HideBanners Special Page
 69+// Set to true on wikis with donation thank you pages.
 70+$wgAllowHideBanners = 'false';
 71+
6872 $wgExtensionFunctions[] = 'efCentralNoticeSetup';
6973
7074 $wgExtensionCredits['other'][] = array(
Index: trunk/extensions/CentralNotice/SpecialHideBanners.php
@@ -5,7 +5,7 @@
66 }
77
88 /**
9 - * Unlisted Special page to set cookies for hiding banners across all wikis.
 9+ * Unlisted Special Page to set cookies for hiding banners across all wikis.
1010 */
1111 class SpecialHideBanners extends UnlistedSpecialPage {
1212 function __construct() {
@@ -13,17 +13,19 @@
1414 }
1515
1616 function execute( $par ) {
17 - global $wgRequest, $wgOut;
 17+ global $wgAllowHideBanners, $wgRequest, $wgOut;
1818
19 - $this->setHideCookie();
20 -
21 - $wgOut->disable();
22 - wfResetOutputBuffers();
23 -
24 - header( 'Content-Type: image/png' );
25 - header( 'Cache-Control: no-cache' );
26 -
27 - readfile( dirname( __FILE__ ) . '/1x1.png' );
 19+ if ( $wgAllowHideBanners ) {
 20+ $this->setHideCookie();
 21+
 22+ $wgOut->disable();
 23+ wfResetOutputBuffers();
 24+
 25+ header( 'Content-Type: image/png' );
 26+ header( 'Cache-Control: no-cache' );
 27+
 28+ readfile( dirname( __FILE__ ) . '/1x1.png' );
 29+ }
2830 }
2931
3032 function setHideCookie() {

Status & tagging log