diff options
Diffstat (limited to 'includes/resourceloader/ResourceLoaderStartUpModule.php')
-rw-r--r-- | includes/resourceloader/ResourceLoaderStartUpModule.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/includes/resourceloader/ResourceLoaderStartUpModule.php b/includes/resourceloader/ResourceLoaderStartUpModule.php index 2a3ba343..f3117378 100644 --- a/includes/resourceloader/ResourceLoaderStartUpModule.php +++ b/includes/resourceloader/ResourceLoaderStartUpModule.php @@ -119,7 +119,10 @@ class ResourceLoaderStartUpModule extends ResourceLoaderModule { } // Automatically register module else { - $mtime = max( $module->getModifiedTime( $context ), wfTimestamp( TS_UNIX, $wgCacheEpoch ) ); + // getModifiedTime() is supposed to return a UNIX timestamp, but it doesn't always + // seem to do that, and custom implementations might forget. Coerce it to TS_UNIX + $moduleMtime = wfTimestamp( TS_UNIX, $module->getModifiedTime( $context ) ); + $mtime = max( $moduleMtime, 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 ) ) { |