From: Roan Kattouw Date: Fri, 8 Oct 2010 10:25:23 +0000 (+0000) Subject: Fix r74454: convert $wgCacheEpoch to a UNIX timestamp before comparing it with other... X-Git-Tag: 1.31.0-rc.0~34583 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=ebb291ce8a94f8e8de5e85fef9dfdb98b2105473;p=lhc%2Fweb%2Fwiklou.git Fix r74454: convert $wgCacheEpoch to a UNIX timestamp before comparing it with other UNIX timestamps --- 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 ) ); }