Do not link the user to its user javascript if the page is empty.
authorPlatonides <platonides@users.mediawiki.org>
Tue, 15 Jun 2010 12:23:14 +0000 (12:23 +0000)
committerPlatonides <platonides@users.mediawiki.org>
Tue, 15 Jun 2010 12:23:14 +0000 (12:23 +0000)
Break user javascript client side caching with the revision id instead of $wgStyleVersion. This way updated version will be automatically served.

includes/OutputPage.php

index 9722be8..713a98b 100644 (file)
@@ -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() );
                                        }
                                }
                        }