Last modified: 2012-04-16 09:15:44 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 27481 - Wrong removal of spaces in javascript
Wrong removal of spaces in javascript
Product: MediaWiki
Classification: Unclassified
ResourceLoader (Other open bugs)
All All
: Normal major (vote)
: ---
Assigned To: Trevor Parscal
Depends on:
Blocks: 27339
  Show dependency treegraph
Reported: 2011-02-17 00:33 UTC by zedlik
Modified: 2012-04-16 09:15 UTC (History)
2 users (show)

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


Description zedlik 2011-02-17 00:33:38 UTC

Resource Loader seems to wrongly remove spaces in javascript code in some cases using debug=false. With debug=true the code remains untouched, so no problem appears.

Test case. The original code is located under [1]. The code compressed by Resource Loader is located under [2]. There is the following line in the first listing:
 InterwikiLinks[i].className += " FA"
after the compressing it appears to be:
 InterwikiLinks[i].className += "FA" (note the dropped space)

Another case. 
 InterwikiLinks[i].title = "Гэта абраны артыкул на іншай мове.";
after the compressing appears to be:
 InterwikiLinks[i].title = "Гэтаабраныартыкулнаіншаймове."; (all the spaces are dropped)

The original code is the valid javascript code, but looks like Resource Loader lost the quote-sign balance and started compressing string literals.

Comment 1 Roan Kattouw 2011-02-17 22:42:00 UTC
It's fixed now. I made a whitespace edit to MediaWiki:Common.js to circumvent caching; this'll take 5 minutes to propagate.

If anyone else encounters a similar issue with site/user JS, making a whitespace edit to the page and waiting 5 minutes should fix it. If it's a core MediaWiki file, please comment on this bug.

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