From: Trevor Parscal Date: Mon, 24 Jan 2011 19:47:57 +0000 (+0000) Subject: Resolves issue in r80656 where escaped quotes within strings are not handled properly... X-Git-Tag: 1.31.0-rc.0~32388 X-Git-Url: http://git.cyclocoop.org/wiki/Target_page?a=commitdiff_plain;h=2fcb86a6c62e840787439a372a78dadda4610a2d;p=lhc%2Fweb%2Fwiklou.git Resolves issue in r80656 where escaped quotes within strings are not handled properly, resulting in the string being truncated. --- 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 ); }