Last modified: 2012-03-28 09:48:34 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 T32681, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 30681 - [Message.php] Wrong escaping for inexistent messages (ie. <message-key>)
[Message.php] Wrong escaping for inexistent messages (ie. <message-key>)
Status: RESOLVED DUPLICATE of bug 14531
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Santhosh Thottingal
: i18n
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-09-01 14:14 UTC by Krinkle
Modified: 2012-03-28 09:48 UTC (History)
6 users (show)

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


Attachments

Description Krinkle 2011-09-01 14:14:48 UTC
When creating a Message instance for an inexistant message they return value is always html escaped, it ignores whether plain() or escaped() is used, it always does:

http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/includes/Message.php?view=markup#l452

> return '&lt;' . key . '&gt;'

If not htmlescaped, it should be < and >. This is currently causing issues when using:

<code>
 Html::element( 'h3', array(), wfMessage( 'blabla' )->plain );
</code>

which results in double escaped input and weird html characters outputted to the user.
Comment 1 Niklas Laxström 2011-09-01 14:28:05 UTC
This is how it has always been with wfMsg*. But otoh I don't think anything relies on this behavior yet with wfMessage, so it could be changed.
Comment 2 Santhosh Thottingal 2012-03-28 09:30:39 UTC
See https://gerrit.wikimedia.org/r/3842
Comment 3 Marcin Cieślak 2012-03-28 09:45:15 UTC
You might want to add some tests in the line of 

https://bugzilla.wikimedia.org/attachment.cgi?id=10221&action=diff

Shouldn't getMessageText() be improved somehow as well?

*** This bug has been marked as a duplicate of bug 14531 ***
Comment 4 Marcin Cieślak 2012-03-28 09:48:34 UTC
ah, forget my remark on getMessageText() :)

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


Navigation
Links