From: Roan Kattouw Date: Thu, 17 Feb 2011 19:19:50 +0000 (+0000) Subject: Revert r82340, caused something linke bug 27481 where spaces were being wrongly colla... X-Git-Tag: 1.31.0-rc.0~31947 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=e7a2f041760ea79134d7afdb3ac15050877902d8;p=lhc%2Fweb%2Fwiklou.git Revert r82340, caused something linke bug 27481 where spaces were being wrongly collapsed. Fixed by changing regex to be more flexible in protecting regexes; nothing wrong with being overinclusive in what we're protecting --- diff --git a/includes/libs/JavaScriptDistiller.php b/includes/libs/JavaScriptDistiller.php index 6ddaf8de3c..6b777424d0 100644 --- a/includes/libs/JavaScriptDistiller.php +++ b/includes/libs/JavaScriptDistiller.php @@ -80,8 +80,8 @@ class JavaScriptDistiller { $parser->add( '/\'([^\'\\\\]*(\\\\.[^\'\\\\]*)*)\'/', '$1' ); $parser->add( '/"([^"\\\\]*(\\\\.[^"\\\\]*)*)"/', '$1' ); // Protect regular expressions - $parser->add( '/([ \\t]+(\\/(?=[^\\/\\r\\n\\*])[^\\/\\\\]*(\\\\.[^\\/\\\\]*)*\\/(i|g)*))/', '$1' ); - $parser->add( '/([^\\w\\$\\/\'"*)\\?:](\\/(?=[^\\/\\r\\n\\*])[^\\/\\\\]*(\\\\.[^\\/\\\\]*)*\\/(i|g)*))/', '$1' ); + $parser->add( '/[ \\t]+((\\/[^\\/\\\\]*(\\\\.[^\\/\\\\]*)*\\/(i|g)*))/', '$1' ); + $parser->add( '/([^\\w\\$\\/\'"*)\\?:](\\/[^\\/\\\\]*(\\\\.[^\\/\\\\]*)*\\/(i|g)*))/', '$1' ); // Remove comments $parser->add( '/\\/\\*(.|[\\r\\n])*?\\*\\//' ); // Preserve the newline after a C++-style comment -- bug 27046