Last modified: 2012-04-16 09:16:05 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 27396 - JS minifier breaks URLs in CSS strings
JS minifier breaks URLs in CSS strings
Product: MediaWiki
Classification: Unclassified
ResourceLoader (Other open bugs)
All All
: Normal critical (vote)
: ---
Assigned To: Trevor Parscal
Depends on:
  Show dependency treegraph
Reported: 2011-02-14 12:37 UTC by Krinkle
Modified: 2012-04-16 09:16 UTC (History)
3 users (show)

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


Description Krinkle 2011-02-14 12:37:04 UTC
On there is:

( jQuery ) );

}, {"all": ".ui-button{display:inline-block; ... background:#e1e1e1 url(http:

mediaWiki.loader.implement("jquery.ui.core",function($,mw){ ...

" ... " is inserted by me and not in the actual code

The "SyntaxError: Parse error" traces back to directly after "http:"

ie. the "//" in http:// was treated as a comment. I'm not sure whether this is caused by the CSS minifer or by the javascript minifier that ran afterwards.

In the end obviously the JavaScript minifier is the one removing the // comment, but the root cause could be in the CSS minifier.

Possible work around:
Don't minify the end output of load.php (ie. the "mediaWiki.loader.implement" calls), but only run javascript minify on the modules themselfs between { and } of the implemenet() call, and the CSS minifer on what is in the later argument.
Reason being that the call to mediaWiki.loader.load are so simple there's no need to minify them, it would only bring in extra unneeded risks such as the js minifier screwing in the css-string.

Ofcourse that's not a permanent solution as there could be a css string like that inside a module as well such as:

$(el).attr('style', 'background: url(http:// ...
appendCSS( 'el { background: url(http:// ...

This is breaking javascript execution completely on some pages of

Comment 1 Roan Kattouw 2011-02-14 21:16:29 UTC
Are you sure this is reproducible on either trunk, REL1_17 or 1.17wmf1? I fixed this a few days ago, and TWN might just be running old code.
Comment 2 Mark A. Hershberger 2011-02-15 20:17:43 UTC
It looks ugly on twn, but seems fine on  This+Roan's comment makes me think it isn't a blocker for now.
Comment 3 Roan Kattouw 2011-02-18 17:25:45 UTC
This should be fixed now. Closing as FIXED, please REOPEN if new problems arise.

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