r80900 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80899‎ | r80900 | r80901 >
Date:19:47, 24 January 2011
Author:tparscal
Status:ok
Tags:
Comment:
Resolves issue in r80656 where escaped quotes within strings are not handled properly, resulting in the string being truncated.
Modified paths:
  • /trunk/phase3/includes/libs/JavaScriptDistiller.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/libs/JavaScriptDistiller.php
@@ -32,8 +32,8 @@
3333 private static function stripComments( $script ) {
3434 $parser = self::createParser();
3535 // Remove comments
36 - $parser->add( '/\\/\\/[^\\r\\n]*[\\r\\n]/' );
37 - $parser->add( '/\\/\\*[^*]*\\*+([^\\/][^*]*\\*+)*\\//' );
 36+ $parser->add( '/\'([^\'\\\\]*(\\\\.[^\'\\\\]*)*)\'/', '$1' );
 37+ $parser->add( '/"([^"\\\\]*(\\\\.[^"\\\\]*)*)"/', '$1' );
3838 // Execute and return
3939 return $parser->exec( $script );
4040 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r810001.17: MFT r80576, r80583, r80656, r80842, r80900, r80913, r80918, r80919, r80...catrope22:49, 25 January 2011
r81707Reimplement r80900, was lost when code was moved aroundcatrope10:26, 8 February 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r80656Resolved bug 26791 by replacing JSMin with a new library called JavaScriptDis...tparscal21:57, 20 January 2011

Status & tagging log