Fix r74454: convert $wgCacheEpoch to a UNIX timestamp before comparing it with other...
authorRoan Kattouw <catrope@users.mediawiki.org>
Fri, 8 Oct 2010 10:25:23 +0000 (10:25 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Fri, 8 Oct 2010 10:25:23 +0000 (10:25 +0000)
includes/ResourceLoader.php
includes/ResourceLoaderModule.php

index e73f443..be66454 100644 (file)
@@ -275,7 +275,7 @@ class ResourceLoader {
                // To send Last-Modified and support If-Modified-Since, we need to detect 
                // the last modified time
                wfProfileIn( __METHOD__.'-getModifiedTime' );
-               $mtime = $wgCacheEpoch;
+               $mtime = wfTimestamp( TS_UNIX, $wgCacheEpoch );
                foreach ( $modules as $module ) {
                        // Bypass squid cache if the request includes any private modules
                        if ( $module->getGroup() === 'private' ) {
index 02de115..b5ab2d6 100644 (file)
@@ -1073,7 +1073,7 @@ class ResourceLoaderStartUpModule extends ResourceLoaderModule {
                        }
                        // Automatically register module
                        else {
-                               $mtime = max( $module->getModifiedTime( $context ), $wgCacheEpoch );
+                               $mtime = max( $module->getModifiedTime( $context ), wfTimestamp( TS_UNIX, $wgCacheEpoch ) );
                                // Modules without dependencies or a group pass two arguments (name, timestamp) to 
                                // mediaWiki.loader.register()
                                if ( !count( $module->getDependencies() && $module->getGroup() === null ) ) {
@@ -1145,7 +1145,7 @@ class ResourceLoaderStartUpModule extends ResourceLoaderModule {
 
                // ATTENTION!: Because of the line above, this is not going to cause infinite recursion - think carefully
                // before making changes to this code!
-               $time = $wgCacheEpoch;
+               $time = wfTimestamp( TS_UNIX, $wgCacheEpoch );
                foreach ( $context->getResourceLoader()->getModules() as $module ) {
                        $time = max( $time, $module->getModifiedTime( $context ) );
                }