From 15bcd02d4c4604c4874633e22399ee359ad49db5 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Mon, 14 Mar 2011 14:25:23 +0000 Subject: [PATCH] (bug 27054) Implicit end of statement can break stuff when files are combined. Applied patch by Paul Copperman: add a semicolon to the end of every module when combining; this'll terminate any unterminated final statement, and otherwise create a harmless empty statement. --- includes/resourceloader/ResourceLoader.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/resourceloader/ResourceLoader.php b/includes/resourceloader/ResourceLoader.php index 8903e5b6a6..86883eddaa 100644 --- a/includes/resourceloader/ResourceLoader.php +++ b/includes/resourceloader/ResourceLoader.php @@ -468,7 +468,9 @@ class ResourceLoader { // Scripts $scripts = ''; if ( $context->shouldIncludeScripts() ) { - $scripts .= $module->getScript( $context ) . "\n"; + // bug 27054: Append semicolon to prevent weird bugs + // caused by files not terminating their statements right + $scripts .= $module->getScript( $context ) . ";\n"; } // Styles -- 2.20.1