Index: trunk/phase3/includes/resourceloader/ResourceLoaderUserOptionsModule.php |
— | — | @@ -40,7 +40,7 @@ |
41 | 41 | global $wgUser; |
42 | 42 | |
43 | 43 | if ( $context->getUser() === $wgUser->getName() ) { |
44 | | - return $this->modifiedTime[$hash] = $wgUser->getTouched(); |
| 44 | + return $this->modifiedTime[$hash] = wfTimestamp( TS_UNIX, $wgUser->getTouched() ); |
45 | 45 | } else { |
46 | 46 | return 1; |
47 | 47 | } |
Index: trunk/phase3/includes/resourceloader/ResourceLoaderStartUpModule.php |
— | — | @@ -116,7 +116,10 @@ |
117 | 117 | } |
118 | 118 | // Automatically register module |
119 | 119 | else { |
120 | | - $mtime = max( $module->getModifiedTime( $context ), wfTimestamp( TS_UNIX, $wgCacheEpoch ) ); |
| 120 | + // getModifiedTime() is supposed to return a UNIX timestamp, but it doesn't always |
| 121 | + // seem to do that, and custom implementations might forget. Coerce it to TS_UNIX |
| 122 | + $moduleMtime = wfTimestamp( TS_UNIX, $module->getModifiedTime( $context ) ); |
| 123 | + $mtime = max( $moduleMtime, wfTimestamp( TS_UNIX, $wgCacheEpoch ) ); |
121 | 124 | // Modules without dependencies or a group pass two arguments (name, timestamp) to |
122 | 125 | // mediaWiki.loader.register() |
123 | 126 | if ( !count( $module->getDependencies() && $module->getGroup() === null ) ) { |