From e7a2f041760ea79134d7afdb3ac15050877902d8 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Thu, 17 Feb 2011 19:19:50 +0000 Subject: [PATCH] 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 --- includes/libs/JavaScriptDistiller.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 -- 2.20.1