From e907403d761f89e5c6820519be30b6bcb5c9b7b8 Mon Sep 17 00:00:00 2001 From: Trevor Parscal Date: Tue, 27 Aug 2013 16:02:52 -0700 Subject: [PATCH] Add support for single scripts, styles and debugScripts Objective: * Make makeStaticLoader.php compatible with ResourceLoader module definitions that use a string instead of an array with a single element when describing a single file Changes: maintenance/makeStaticLoader.php * Cast styles, scripts and debugScripts to array when iterating over them Change-Id: Ib91daba732c2035145c479467a0b6b9ca3155659 --- maintenance/makeStaticLoader.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/maintenance/makeStaticLoader.php b/maintenance/makeStaticLoader.php index c117ce68db..896698ad27 100644 --- a/maintenance/makeStaticLoader.php +++ b/maintenance/makeStaticLoader.php @@ -162,7 +162,7 @@ class MakeStaticLoader extends Maintenance { $headAdd = $bodyAdd = ''; if ( isset( $registry['styles'] ) && $target !== 'test' ){ - foreach ( $registry['styles'] as $path ) { + foreach ( (array)$registry['styles'] as $path ) { if ( strpos( $path, 've-mw/' ) === 0 ) { continue; } @@ -173,7 +173,7 @@ class MakeStaticLoader extends Maintenance { } } if ( isset( $registry['scripts'] ) ) { - foreach ( $registry['scripts'] as $path ) { + foreach ( (array)$registry['scripts'] as $path ) { if ( strpos( $path, 've-mw/' ) === 0 ) { continue; } @@ -181,7 +181,7 @@ class MakeStaticLoader extends Maintenance { } } if ( isset( $registry['debugScripts'] ) ) { - foreach ( $registry['debugScripts'] as $path ) { + foreach ( (array)$registry['debugScripts'] as $path ) { if ( strpos( $path, 've-mw/' ) === 0 ) { continue; }