Last modified: 2012-10-06 09:08:07 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 T42660, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 40660 - ResourceLoaderWikiModule should not convert " " to a space for pages from the MediaWiki-namespace
ResourceLoaderWikiModule should not convert " " to a space for pages fro...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
ResourceLoader (Other open bugs)
1.17.x
All All
: Normal major (vote)
: 1.20.0 release
Assigned To: Roan Kattouw
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-01 14:32 UTC by Brad Jorsch
Modified: 2012-10-06 09:08 UTC (History)
4 users (show)

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


Attachments

Description Brad Jorsch 2012-10-01 14:32:06 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.
Comment 1 Niklas Laxström 2012-10-01 15:16:21 UTC
RL shouldn't be loading JS/CSS via wfMessage. Work around is to split the string into two parts.
Comment 2 Krinkle 2012-10-01 17:19:45 UTC
(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).
Comment 3 Roan Kattouw 2012-10-02 02:43:37 UTC
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.
Comment 4 Roan Kattouw 2012-10-02 03:24:11 UTC
https://gerrit.wikimedia.org/r/25986
Comment 5 Krinkle 2012-10-06 09:08:07 UTC
Ica7f35fefcc200f0b3daf1d06d98a0b8ea878f3a.

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


Navigation
Links