resourceloader: Add filter cache version to module version hash
[lhc/web/wiklou.git] / includes / resourceloader / ResourceLoaderWikiModule.php
index 53ae435..fe77576 100644 (file)
@@ -23,6 +23,7 @@
  */
 
 use MediaWiki\Linker\LinkTarget;
+use Wikimedia\Assert\Assert;
 use Wikimedia\Rdbms\Database;
 use Wikimedia\Rdbms\IDatabase;
 
@@ -76,7 +77,8 @@ class ResourceLoaderWikiModule extends ResourceLoaderModule {
        protected $group;
 
        /**
-        * @param array $options For back-compat, this can be omitted in favour of overwriting getPages.
+        * @param array|null $options For back-compat, this can be omitted in favour of overwriting
+        *  getPages.
         */
        public function __construct( array $options = null ) {
                if ( is_null( $options ) ) {
@@ -534,6 +536,10 @@ class ResourceLoaderWikiModule extends ResourceLoaderModule {
        ) {
                static $formats = [ CONTENT_FORMAT_CSS, CONTENT_FORMAT_JAVASCRIPT ];
 
+               Assert::parameterType( 'string', $wikiId, '$wikiId' );
+
+               // TODO: MCR: differentiate between page functionality and content model!
+               //       Not all pages containing CSS or JS have to be modules! [PageType]
                if ( $old && in_array( $old->getContentFormat(), $formats ) ) {
                        $purge = true;
                } elseif ( $new && in_array( $new->getContentFormat(), $formats ) ) {