From: Platonides Date: Tue, 15 Jun 2010 12:23:14 +0000 (+0000) Subject: Do not link the user to its user javascript if the page is empty. X-Git-Tag: 1.31.0-rc.0~36504 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=b04925c95fbb56213a714ea702a62eaa85c2bb11;p=lhc%2Fweb%2Fwiklou.git 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. --- diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 9722be80ed..713a98b7a9 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -2233,9 +2233,9 @@ class OutputPage { NS_USER, $userpage->getDBkey() . '/' . $name . '.js' ); - if ( $scriptpage && $scriptpage->exists() ) { + if ( $scriptpage && $scriptpage->exists() && ( $scriptpage->getLength() > 0 ) ) { $userjs = $scriptpage->getLocalURL( 'action=raw&ctype=' . $wgJsMimeType ); - $this->addScriptFile( $userjs ); + $this->addScriptFile( $userjs, $scriptpage->getLatestRevID() ); } } }