Last modified: 2011-02-17 17:08:37 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T29492, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 27492 - JS minification error with regular expressions
JS minification error with regular expressions
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
ResourceLoader (Other open bugs)
1.17.x
All All
: Normal critical (vote)
: ---
Assigned To: Trevor Parscal
:
Depends on:
Blocks: 26611 26676
  Show dependency treegraph
 
Reported: 2011-02-17 10:28 UTC by Michael M.
Modified: 2011-02-17 17:08 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Michael M. 2011-02-17 10:28:06 UTC
The JS minification interprets // in regular expressions as beginning a comment and so removes following code.

Example:
  if (/\/commons\//.test($this.find('img').attr('src')))
is minified to
  if(/\/commons\
Comment 2 Krinkle 2011-02-17 11:45:38 UTC
http://translatewiki.net/w/load.php?debug=false&lang=nl&modules=site&only=scripts&skin=modern

jQuery(document).ready(function($){
var $this=$('#content');
if(/\/commons\

   |> SyntaxError: Parse error

});
mediaWiki.loader.state({"site":"ready"});
Comment 3 Roan Kattouw 2011-02-17 17:08:37 UTC
This only fails for regexes which contain a slash at the end (causing //) AND contain a slash somewhere in the middle (causing the minifier to incorrectly regard it as the end of the regex).

Fixed in r82340

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links