Fix for r82344, which causes JSDistiller to stop minifying comments because it though...
[lhc/web/wiklou.git] / 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