From 4f09b0fa47861f5caa22381edfeba700a7e0607b Mon Sep 17 00:00:00 2001 From: Trevor Parscal Date: Tue, 19 Oct 2010 22:53:53 +0000 Subject: [PATCH] Fixed case where tryForKey can sometimes not return an array --- includes/resourceloader/ResourceLoaderFileModule.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/resourceloader/ResourceLoaderFileModule.php b/includes/resourceloader/ResourceLoaderFileModule.php index b247254f21..bcf750de86 100644 --- a/includes/resourceloader/ResourceLoaderFileModule.php +++ b/includes/resourceloader/ResourceLoaderFileModule.php @@ -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(); } -- 2.20.1