r68065 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r68064‎ | r68065 | r68066 >
Date:12:23, 15 June 2010
Author:platonides
Status:ok (Comments)
Tags:
Comment:
Do not link the user to its user javascript if the page is empty.
Break user javascript client side caching with the revision id instead of $wgStyleVersion. This way updated version will be automatically served.
Modified paths:
  • /trunk/phase3/includes/OutputPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/OutputPage.php
@@ -2233,9 +2233,9 @@
22342234 NS_USER,
22352235 $userpage->getDBkey() . '/' . $name . '.js'
22362236 );
2237 - if ( $scriptpage && $scriptpage->exists() ) {
 2237+ if ( $scriptpage && $scriptpage->exists() && ( $scriptpage->getLength() > 0 ) ) {
22382238 $userjs = $scriptpage->getLocalURL( 'action=raw&ctype=' . $wgJsMimeType );
2239 - $this->addScriptFile( $userjs );
 2239+ $this->addScriptFile( $userjs, $scriptpage->getLatestRevID() );
22402240 }
22412241 }
22422242 }

Comments

#Comment by Catrope (talk | contribs)   18:06, 15 June 2010
+					if ( $scriptpage && $scriptpage->exists() && ( $scriptpage->getLength() > 0 ) ) {

You don't need to parenthesize that.

#Comment by Platonides (talk | contribs)   19:11, 15 June 2010

I find more clear to add parenthesis in the conditions, but feel free to remove them.

Status & tagging log