r108587 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r108586‎ | r108587 | r108588 >
Date:01:37, 11 January 2012
Author:preilly
Status:ok
Tags:
Comment:
1.18wmf1: MFT r108586
Modified paths:
  • /branches/wmf/1.18wmf1/extensions/ZeroRatedMobileAccess/ZeroRatedMobileAccess.body.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.18wmf1/extensions/ZeroRatedMobileAccess/ZeroRatedMobileAccess.body.php
@@ -114,20 +114,22 @@
115115 } elseif ( self::$renderZeroRatedBanner === true ) {
116116 // a2enmod headers >>> .htaccess >>> RequestHeader set HTTP_CARRIER Verizon
117117 self::$carrier = $this->lookupCarrier( $carrier );
118 - $html = $out->getHTML();
119 - $parsedHtml = $this->parseLinksForZeroQueryString( $html );
120 - $out->clearHTML();
121 - $out->addHTML( $parsedHtml );
122 - $carrierLink = ( isset( self::$carrier['link'] ) ) ? self::$carrier['link'] : '';
123 - $bannerText = Html::rawElement( 'h3',
124 - array( 'id' => 'zero-rated-banner-text' ),
125 - wfMsg( 'zero-rated-mobile-access-banner-text', $carrierLink ) );
126 - $banner = Html::rawElement( 'div',
127 - array( 'style' => 'display:none;',
128 - 'id' => 'zero-rated-banner' ),
129 - $bannerText
130 - );
131 - $output .= $banner;
 118+ if ( isset( self::$carrier['name'] ) ) {
 119+ $html = $out->getHTML();
 120+ $parsedHtml = $this->parseLinksForZeroQueryString( $html );
 121+ $out->clearHTML();
 122+ $out->addHTML( $parsedHtml );
 123+ $carrierLink = ( isset( self::$carrier['link'] ) ) ? self::$carrier['link'] : '';
 124+ $bannerText = Html::rawElement( 'h3',
 125+ array( 'id' => 'zero-rated-banner-text' ),
 126+ wfMsg( 'zero-rated-mobile-access-banner-text', $carrierLink ) );
 127+ $banner = Html::rawElement( 'div',
 128+ array( 'style' => 'display:none;',
 129+ 'id' => 'zero-rated-banner' ),
 130+ $bannerText
 131+ );
 132+ $output .= $banner;
 133+ }
132134 }
133135 if ( self::$renderZeroRatedLandingPage === true ) {
134136 $out->clearHTML();
@@ -806,6 +808,6 @@
807809 }
808810
809811 public function getVersion() {
810 - return __CLASS__ . ': $Id: ZeroRatedMobileAccess.body.php 108582 2012-01-11 01:03:51Z preilly $';
 812+ return __CLASS__ . ': $Id: ZeroRatedMobileAccess.body.php 108586 2012-01-11 01:36:07Z preilly $';
811813 }
812814 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r108655r108587: Register extension for translatewiki.net. Enabled on WMF cluster alr...raymond19:23, 11 January 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r108586only display banner if carrier is foundpreilly01:36, 11 January 2012

Status & tagging log