r114269 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r114268‎ | r114269 | r114270 >
Date:14:11, 20 March 2012
Author:reedy
Status:ok
Tags:
Comment:
Move declaration of referrer up a line to fix undefined variable

Remove unused global, documentation for title object
Modified paths:
  • /trunk/extensions/ZeroRatedMobileAccess/ZeroRatedMobileAccess.body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ZeroRatedMobileAccess/ZeroRatedMobileAccess.body.php
@@ -32,7 +32,12 @@
3333 private static $debugOutput = array();
3434 private static $displayDebugOutput = false;
3535 private static $formatMobileUrl = '//%s.m.wikipedia.org/';
 36+
 37+ /**
 38+ * @var Title
 39+ */
3640 private static $title;
 41+
3742 private static $isFilePage;
3843 public static $isMainPage = false;
3944 private static $acceptBilling;
@@ -55,7 +60,7 @@
5661 * @return bool
5762 */
5863 public function beforePageDisplayHTML( &$out, &$text ) {
59 - global $wgRequest, $wgConf, $wgEnableZeroRatedMobileAccessTesting, $wgZeroDisableImages, $wgSitename;
 64+ global $wgRequest, $wgConf, $wgEnableZeroRatedMobileAccessTesting, $wgZeroDisableImages;
6065 wfProfileIn( __METHOD__ );
6166
6267 $DB = wfGetDB( DB_MASTER );
@@ -110,10 +115,10 @@
111116 }
112117
113118 if ( self::$isFilePage && self::$acceptBilling !== 'yes' && self::$renderZeroRatedBanner === true ) {
 119+ $referrer = $wgRequest->getHeader( 'referer' );
114120 $acceptBillingYes = Html::rawElement( 'a',
115121 array( 'href' => str_replace( '.wikipedia.org/', '.m.wikipedia.org/', wfExpandUrl( $wgRequest->appendQuery( 'acceptbilling=yes' . urlencode( $referrer ) ), PROTO_CURRENT ) ) ),
116122 wfMsg( 'zero-rated-mobile-access-banner-text-data-charges-yes' ) );
117 - $referrer = $wgRequest->getHeader( 'referer' );
118123 $acceptBillingNo = Html::rawElement( 'a',
119124 array( 'href' => $wgRequest->appendQuery( 'acceptbilling=no&returnto=' . urlencode( $referrer ) ) ),
120125 wfMsg( 'zero-rated-mobile-access-banner-text-data-charges-no' ) );

Status & tagging log