Last modified: 2012-10-06 09:08:07 UTC
If a Javascript file loaded through ResourceLoader contains the text strings " ", " ", or " ", these will be changed to a raw space or non-breaking space. This causes a problem in [[en:MediaWiki:Gadget-charinsert.js]], as that gadget wants to effectively do document.createTextNode(' ') to include the literal string " " in the charinsert box. The source of the replacement is in includes/cache/MessageCache.php, at the end of get(). Since that's in such a low-level function, I don't know what the consequences of changing it might be for other messages. Another possibility might be to have ResourceLoader use getMsgFromNamespace instead to avoid the problematic replacement.
RL shouldn't be loading JS/CSS via wfMessage. Work around is to split the string into two parts.
(In reply to comment #1) > RL shouldn't be loading JS/CSS via wfMessage. Work around is to split the > string into two parts. ResourceLoaderWikiModule uses Revision::getRawText, except if it comes from NS_MEDIAWIKI in which case it tries MessageCache first (for efficiency I guess).
I think the reason we do it this way is because technically MediaWiki: pages are messages, and they can have default values in the .i18n.php files that we want to respect. But I don't think that's really ever used by anyone, I'll try removing this logic.
https://gerrit.wikimedia.org/r/25986
Ica7f35fefcc200f0b3daf1d06d98a0b8ea878f3a.