Fix for r82344, which causes JSDistiller to stop minifying comments because it though...
authorRoan Kattouw <catrope@users.mediawiki.org>
Thu, 17 Feb 2011 22:07:18 +0000 (22:07 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Thu, 17 Feb 2011 22:07:18 +0000 (22:07 +0000)
includes/libs/JavaScriptDistiller.php

index 6b77742..a5aae1e 100644 (file)
@@ -80,8 +80,8 @@ class JavaScriptDistiller {
                $parser->add( '/\'([^\'\\\\]*(\\\\.[^\'\\\\]*)*)\'/', '$1' );
                $parser->add( '/"([^"\\\\]*(\\\\.[^"\\\\]*)*)"/', '$1' );
                // Protect regular expressions
-               $parser->add( '/[ \\t]+((\\/[^\\/\\\\]*(\\\\.[^\\/\\\\]*)*\\/(i|g)*))/', '$1' );
-               $parser->add( '/([^\\w\\$\\/\'"*)\\?:](\\/[^\\/\\\\]*(\\\\.[^\\/\\\\]*)*\\/(i|g)*))/', '$1' );
+               $parser->add( '/[ \\t]+((\\/[^\\r\\n\\*][^\\/\\r\\n\\\\]*(\\\\.[^\\/\\r\\n\\\\]*)*\\/(i|g)*))/', '$1' );
+               $parser->add( '/([^\\w\\$\\/\'"*)\\?:](\\/[^\\r\\n\\*][^\\/\\r\\n\\\\]*(\\\\.[^\\/\\r\\n\\\\]*)*\\/(i|g)*))/', '$1' );
                // Remove comments
                $parser->add( '/\\/\\*(.|[\\r\\n])*?\\*\\//' );
                // Preserve the newline after a C++-style comment -- bug 27046