r108538 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r108537‎ | r108538 | r108539 >
Date:19:54, 10 January 2012
Author:preilly
Status:resolved (Comments)
Tags:
Comment:
do not call the addHTML method unless needed also check carrier header correctly
Modified paths:
  • /trunk/extensions/ZeroRatedMobileAccess/ZeroRatedMobileAccess.body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ZeroRatedMobileAccess/ZeroRatedMobileAccess.body.php
@@ -47,7 +47,7 @@
4848 self::$title = $out->getTitle();
4949
5050 $carrier = $wgRequest->getHeader( 'HTTP_X_CARRIER' );
51 - if ( $carrier !== '(null)') {
 51+ if ( $carrier !== '(null)' && $carrier ) {
5252 self::$renderZeroRatedBanner = true;
5353 }
5454
@@ -203,11 +203,14 @@
204204 }
205205
206206 $output .= Html::closeElement( 'div' );
207 - $out->addHTML( $output );
 207+ if ( $output != '<div id="zero-landing-page"></div>' ) {
 208+ $out->addHTML( $output );
 209+ }
 210+
208211 wfProfileOut( __METHOD__ );
209212 return true;
210213 }
211 -
 214+
212215 /**
213216 * Returns information about carrier
214217 *

Follow-up revisions

RevisionCommit summaryAuthorDate
r108651fix for r108538 c29341preilly18:57, 11 January 2012

Comments

#Comment by Nikerabbit (talk | contribs)   07:21, 11 January 2012

This doesn't look like a good idea, the output generated by Html:: functions depends on some configuration variables.

  		$output .= Html::closeElement( 'div' );
 +		if ( $output != '<div id="zero-landing-page"></div>' ) {

Status & tagging log