r74502 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r74501‎ | r74502 | r74503 >
Date:10:25, 8 October 2010
Author:catrope
Status:ok
Tags:
Comment:
Fix r74454: convert $wgCacheEpoch to a UNIX timestamp before comparing it with other UNIX timestamps
Modified paths:
  • /trunk/phase3/includes/ResourceLoader.php (modified) (history)
  • /trunk/phase3/includes/ResourceLoaderModule.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/ResourceLoader.php
@@ -275,7 +275,7 @@
276276 // To send Last-Modified and support If-Modified-Since, we need to detect
277277 // the last modified time
278278 wfProfileIn( __METHOD__.'-getModifiedTime' );
279 - $mtime = $wgCacheEpoch;
 279+ $mtime = wfTimestamp( TS_UNIX, $wgCacheEpoch );
280280 foreach ( $modules as $module ) {
281281 // Bypass squid cache if the request includes any private modules
282282 if ( $module->getGroup() === 'private' ) {
Index: trunk/phase3/includes/ResourceLoaderModule.php
@@ -1073,7 +1073,7 @@
10741074 }
10751075 // Automatically register module
10761076 else {
1077 - $mtime = max( $module->getModifiedTime( $context ), $wgCacheEpoch );
 1077+ $mtime = max( $module->getModifiedTime( $context ), wfTimestamp( TS_UNIX, $wgCacheEpoch ) );
10781078 // Modules without dependencies or a group pass two arguments (name, timestamp) to
10791079 // mediaWiki.loader.register()
10801080 if ( !count( $module->getDependencies() && $module->getGroup() === null ) ) {
@@ -1145,7 +1145,7 @@
11461146
11471147 // ATTENTION!: Because of the line above, this is not going to cause infinite recursion - think carefully
11481148 // before making changes to this code!
1149 - $time = $wgCacheEpoch;
 1149+ $time = wfTimestamp( TS_UNIX, $wgCacheEpoch );
11501150 foreach ( $context->getResourceLoader()->getModules() as $module ) {
11511151 $time = max( $time, $module->getModifiedTime( $context ) );
11521152 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r74454(bug 25201) Respect $wgCacheEpoch in the resource loader...catrope19:35, 7 October 2010

Status & tagging log