r93566 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r93565‎ | r93566 | r93567 >
Date:02:55, 31 July 2011
Author:kaldari
Status:ok (Comments)
Tags:
Comment:
fix for Bug 30139 - JS error in Chrome
Modified paths:
  • /trunk/extensions/CentralNotice/special/SpecialBannerController.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralNotice/special/SpecialBannerController.php
@@ -166,7 +166,7 @@
167167 $script .= "\n\t\tvar url = '" .
168168 Xml::escapeJsString( $wgNoticeFundraisingUrl ) . "';";
169169 $script .= <<<JAVASCRIPT
170 - if ( bannerJson.landingPages.length ) {
 170+ if ( bannerJson.landingPages && bannerJson.landingPages.length ) {
171171 targets = String( bannerJson.landingPages ).split(',');
172172 url += "?" + jQuery.param( {
173173 'landing_page': targets[Math.floor( Math.random() * targets.length )].replace( /^\s+|\s+$/, '' )

Follow-up revisions

RevisionCommit summaryAuthorDate
r93567follow-up to r93566, more foolproof fixkaldari03:00, 31 July 2011

Comments

#Comment by Kaldari (talk | contribs)   03:02, 31 July 2011

Actually, I just realized someone might set landingPages equal to 'false' or '0' or something (as unlikely as that may be), so I've replaced this with r93567.

Status & tagging log