r114292 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r114291‎ | r114292 | r114293 >
Date:18:24, 20 March 2012
Author:preilly
Status:ok
Tags:
Comment:
1.19wmf: MFT r114291
Modified paths:
  • /branches/wmf/1.19wmf1/extensions/ZeroRatedMobileAccess/ZeroRatedMobileAccess.body.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.19wmf1/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' ) );
@@ -210,6 +215,7 @@
211216 wfMessage( 'zero-rated-mobile-access-home-page-selection',
212217 $languageName )->inLanguage( $languageCode )
213218 );
 219+ $languageLink = str_replace( '.m.wikipedia.org', '.zero.wikipedia.org', $languageLink );
214220 $output .= Html::rawElement( 'h3', array( 'id' => 'lang_' . $languageCode ), $languageLink );
215221 }
216222 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r114291zero rated links for language homepage linkspreilly18:21, 20 March 2012

Status & tagging log