r75181 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75180‎ | r75181 | r75182 >
Date:01:55, 22 October 2010
Author:kaldari
Status:resolved (Comments)
Tags:
Comment:
potential fix for stats issue
Modified paths:
  • /trunk/extensions/CentralNotice/CentralNotice.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralNotice/CentralNotice.php
@@ -142,9 +142,10 @@
143143 }
144144
145145 function efCentralNoticeLoader( $out, $skin ) {
146 - global $wgUser, $wgOut, $wgCentralDBname;
 146+ global $wgUser, $wgOut, $wgCentralDBname, $wgScript;
147147
148 - $centralLoader = SpecialPage::getTitleFor( 'BannerController' )->getLocalUrl();
 148+ // Include '.js' to exempt script from squid cache override
 149+ $centralLoader = $wgScript . '?title=' . SpecialPage::getTitleFor( 'BannerController' ) . '&cn.js';
149150
150151 // Insert the banner controller Javascript into the <head>
151152 $wgOut->addScriptFile( $centralLoader );

Follow-up revisions

RevisionCommit summaryAuthorDate
r75370fixes for r75222 and r75181kaldari17:53, 25 October 2010

Comments

#Comment by Catrope (talk | contribs)   13:57, 23 October 2010
-	$centralLoader = SpecialPage::getTitleFor( 'BannerController' )->getLocalUrl();
+	// Include '.js' to exempt script from squid cache override
+	$centralLoader = $wgScript . '?title=' . SpecialPage::getTitleFor( 'BannerController' ) . '&cn.js';

Don't build the URL yourself, use ->getLocalUrl( 'cache=cn.js' ) (the parameter can also be an array).

#Comment by Kaldari (talk | contribs)   17:37, 25 October 2010

Cool, I had no idea that getLocalUrl() switched to using the non-rewritten URL if you pass it a parameter. That kills 2 birds with one stone.

#Comment by Kaldari (talk | contribs)   18:40, 25 October 2010

fixed in r75370.

Status & tagging log