Fixed case where tryForKey can sometimes not return an array
authorTrevor Parscal <tparscal@users.mediawiki.org>
Tue, 19 Oct 2010 22:53:53 +0000 (22:53 +0000)
committerTrevor Parscal <tparscal@users.mediawiki.org>
Tue, 19 Oct 2010 22:53:53 +0000 (22:53 +0000)
includes/resourceloader/ResourceLoaderFileModule.php

index b247254..bcf750d 100644 (file)
@@ -317,9 +317,9 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
         */
        protected static function tryForKey( $list, $key, $fallback = null ) {
                if ( isset( $list[$key] ) && is_array( $list[$key] ) ) {
-                       return $list[$key];
+                       return (array) $list[$key];
                } else if ( is_string( $fallback ) && isset( $list[$fallback] ) ) {
-                       return $list[$fallback];
+                       return (array) $list[$fallback];
                }
                return array();
        }