From 2fcb86a6c62e840787439a372a78dadda4610a2d Mon Sep 17 00:00:00 2001 From: Trevor Parscal Date: Mon, 24 Jan 2011 19:47:57 +0000 Subject: [PATCH] Resolves issue in r80656 where escaped quotes within strings are not handled properly, resulting in the string being truncated. --- 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 6db1e7371b..c15d870c51 100644 --- a/includes/libs/JavaScriptDistiller.php +++ b/includes/libs/JavaScriptDistiller.php @@ -32,8 +32,8 @@ class JavaScriptDistiller { private static function stripComments( $script ) { $parser = self::createParser(); // Remove comments - $parser->add( '/\\/\\/[^\\r\\n]*[\\r\\n]/' ); - $parser->add( '/\\/\\*[^*]*\\*+([^\\/][^*]*\\*+)*\\//' ); + $parser->add( '/\'([^\'\\\\]*(\\\\.[^\'\\\\]*)*)\'/', '$1' ); + $parser->add( '/"([^"\\\\]*(\\\\.[^"\\\\]*)*)"/', '$1' ); // Execute and return return $parser->exec( $script ); } -- 2.20.1