resourceloader: Fix broken skinStyles loop in #getModifiedTime
authorTimo Tijhof <krinklemail@gmail.com>
Fri, 28 Feb 2014 19:23:11 +0000 (20:23 +0100)
committerKrinkle <krinklemail@gmail.com>
Fri, 28 Feb 2014 19:24:51 +0000 (19:24 +0000)
The way we interpret the 'skinStyles' array in #getModifiedTime
is broken. For comparision, look at the loop in #getStyleFiles
which we use for the creation of the actual stylesheets (which
works fine).

It mixed up the logic causing it to always end up with an empty
array. So it's not so much that it fails to detect the files
having changed after an update, it never included mtimes of these
files in the first place. If there'd be a module with only
skinStyles resources, it would have timestamp 0 (1970).

Bug: 62068
Change-Id: I2e772a13183e66e4bfbf95057ebfd7f5e0d817ec

includes/resourceloader/ResourceLoaderFileModule.php

index 23d5825..68bfe59 100644 (file)
@@ -429,10 +429,11 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
                foreach ( $styles as $styleFiles ) {
                        $files = array_merge( $files, $styleFiles );
                }
-               $skinFiles = self::tryForKey(
-                       self::collateFilePathListByOption( $this->skinStyles, 'media', 'all' ),
-                       $context->getSkin(),
-                       'default'
+
+               $skinFiles = self::collateFilePathListByOption(
+                       self::tryForKey( $this->skinStyles, $context->getSkin(), 'default' ),
+                       'media',
+                       'all'
                );
                foreach ( $skinFiles as $styleFiles ) {
                        $files = array_merge( $files, $styleFiles );
@@ -614,7 +615,9 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
                return array_merge_recursive(
                        self::collateFilePathListByOption( $this->styles, 'media', 'all' ),
                        self::collateFilePathListByOption(
-                               self::tryForKey( $this->skinStyles, $context->getSkin(), 'default' ), 'media', 'all'
+                               self::tryForKey( $this->skinStyles, $context->getSkin(), 'default' ),
+                               'media',
+                               'all'
                        )
                );
        }