Petr Kadlec wrote:
I am working on an update of really outdated
LanguageCs.php (using the
up-to-date messages in cs:MediaWiki namespace) and I have found a
problem I do not understand:
In SpecialBlockip.php, there are commands like
$wgOut->addWikiText( htmlspecialchars( wfMsg( "blockiptext" ) ) );
AFAICS this means that no HTML entities may occur in the blockiptext
message (as every & gets converted to &). Is there any reason for
that? Why not drop the htmlspecialchars() out? Is there any generic
rule when it is used and when not? (I mean, some other special pages
seem to use addHTML( wfMsg( ... ) ) etc.)
I don't think there's any particular reason for that, besides helping
out translators who generally don't know HTML. Remember that wfMsg() can
take parameters, and such parameters always have to be cleaned before
being output if they come from the user.
-- Tim Starling