Reimplement r80900, was lost when code was moved around
authorRoan Kattouw <catrope@users.mediawiki.org>
Tue, 8 Feb 2011 10:26:30 +0000 (10:26 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Tue, 8 Feb 2011 10:26:30 +0000 (10:26 +0000)
includes/libs/JavaScriptDistiller.php

index 3e0a00f..dd0c35d 100644 (file)
@@ -77,8 +77,8 @@ class JavaScriptDistiller {
                // Protect strings. The original code had [^\'\\v] here, but that didn't armor multiline
                // strings correctly. This also armors multiline strings that don't have backslashes at the
                // end of the line (these are invalid), but that's fine because we're just armoring here.
-               $parser->add( '/\'[^\']*\'/', '$1' );
-               $parser->add( '/"[^"]*"/', '$1' );
+               $parser->add( '/\'([^\'\\\\]*(\\\\.[^\'\\\\]*)*)\'/', '$1' );
+               $parser->add( '/"([^"\\\\]*(\\\\.[^"\\\\]*)*)"/', '$1' );
                // Protect regular expressions
                $parser->add( '/[ \\t]+(\\/[^\\/\\r\\n\\*][^\\/\\r\\n]*\\/g?i?)/', '$2' );
                $parser->add( '/[^\\w\\$\\/\'"*)\\?:]\\/[^\\/\\r\\n\\*][^\\/\\r\\n]*\\/g?i?/', '$1' );