From: Kunal Mehta Date: Thu, 28 Aug 2014 20:16:03 +0000 (-0700) Subject: resourceloader: Don't register raw modules client-side X-Git-Tag: 1.31.0-rc.0~14242^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/password.php?a=commitdiff_plain;h=1e063f6078;p=lhc%2Fweb%2Fwiklou.git resourceloader: Don't register raw modules client-side Prevents modules from depending on raw modules, like 'mediawiki' & 'jquery'. To do that, those modules (as designated by raw=>true), aren't registered in the module registry. Change-Id: Iac37a236964dc40d6259988a0baaaa6331b54ec6 --- diff --git a/includes/resourceloader/ResourceLoaderStartUpModule.php b/includes/resourceloader/ResourceLoaderStartUpModule.php index 78fe45c72e..e455ef11ef 100644 --- a/includes/resourceloader/ResourceLoaderStartUpModule.php +++ b/includes/resourceloader/ResourceLoaderStartUpModule.php @@ -207,6 +207,13 @@ class ResourceLoaderStartUpModule extends ResourceLoaderModule { continue; } + if ( $module->isRaw() ) { + // Don't register "raw" modules (like 'jquery' and 'mediawiki') client-side because + // depending on them is illegal anyway and would only lead to them being reloaded + // causing any state to be lost (like jQuery plugins, mw.config etc.) + continue; + } + // 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 ) );