From ebb291ce8a94f8e8de5e85fef9dfdb98b2105473 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Fri, 8 Oct 2010 10:25:23 +0000 Subject: [PATCH] Fix r74454: convert $wgCacheEpoch to a UNIX timestamp before comparing it with other UNIX timestamps --- includes/ResourceLoader.php | 2 +- includes/ResourceLoaderModule.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/ResourceLoader.php b/includes/ResourceLoader.php index e73f4433ce..be66454bdf 100644 --- a/includes/ResourceLoader.php +++ b/includes/ResourceLoader.php @@ -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' ) { diff --git a/includes/ResourceLoaderModule.php b/includes/ResourceLoaderModule.php index 02de115744..b5ab2d686d 100644 --- a/includes/ResourceLoaderModule.php +++ b/includes/ResourceLoaderModule.php @@ -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 ) ); } -- 2.20.1