r82357 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r82356‎ | r82357 | r82358 >
Date:22:36, 17 February 2011
Author:catrope
Status:deferred (Comments)
Tags:
Comment:
Fix a bug in string recognition in JSDistiller. This *really* fixes bug 27481
Modified paths:
  • /trunk/phase3/includes/libs/JavaScriptDistiller.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/libs/JavaScriptDistiller.php
@@ -77,8 +77,8 @@
7878 // Protect strings. The original code had [^\'\\v] here, but that didn't armor multiline
7979 // strings correctly. This also armors multiline strings that don't have backslashes at the
8080 // end of the line (these are invalid), but that's fine because we're just armoring here.
81 - $parser->add( '/\'([^\'\\\\]*(\\\\.[^\'\\\\]*)*)\'/', '$1' );
82 - $parser->add( '/"([^"\\\\]*(\\\\.[^"\\\\]*)*)"/', '$1' );
 81+ $parser->add( '/\'([^\'\\\\]*(\\\\(.|[\r\n])[^\'\\\\]*)*)\'/', '$1' );
 82+ $parser->add( '/"([^"\\\\]*(\\\\(.|[\r\n])[^"\\\\]*)*)"/', '$1' );
8383 // Protect regular expressions
8484 $parser->add( '/[ \\t]+((\\/[^\\r\\n\\*][^\\/\\r\\n\\\\]*(\\\\.[^\\/\\r\\n\\\\]*)*\\/(i|g)*))/', '$1' );
8585 $parser->add( '/([^\\w\\$\\/\'"*)\\?:](\\/[^\\r\\n\\*][^\\/\\r\\n\\\\]*(\\\\.[^\\/\\r\\n\\\\]*)*\\/(i|g)*))/', '$1' );

Follow-up revisions

RevisionCommit summaryAuthorDate
r823581.17wmf1: MFT r82357catrope22:37, 17 February 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r82344Revert r82340, caused something linke bug 27481 where spaces were being wrong...catrope19:19, 17 February 2011

Comments

#Comment by MaxSem (talk | contribs)   05:07, 18 February 2011

There are no tests?

#Comment by Nikerabbit (talk | contribs)   07:46, 18 February 2011

Yep, can't be sure without tests.

#Comment by 😂 (talk | contribs)   14:57, 19 April 2011

Guess it doesn't matter since r86385.

Status & tagging log