Bawolff added a comment.

Why is this even being parsed as a list, anyways? The plain text of the message is:

Restore revision 597045630 by [[Special:Contributions/*Youngjin|{{GENDER:*Youngjin|*Youngjin}}]]

There’s no * anywhere near the beginning of a line, and yet a list is emitted. This can also be reproduced outside of this message, e. g. with foo{{GENDER:|*bar}}. Is that a bug of {{GENDER}}?

This is a well known feature of parser functions (That they add newlines). The behaviour is very controversial, but is probably here to stay for back compatibility if nothing else. See T14974

Alternative fix: wrap the user name in <nowiki>.

Just use the wfEscapeWikitext() global function (Defined in includes/GlobalFunctions.php), that's the standard solution the rest of MediaWiki uses.

 :, #, <, >, [, ], {, } are not allowed in usernames.
' appears to get escaped.
& is allowed in usernames, and in fact MediaWiki seems to treat &quot; and " as the same user everywhere, so I assume allowing HTML entities in usernames is a feature(?). However, “double HTML entities” like &amp;quot; are not allowed.

Well you've also got percent encoding behaves weirdly in usernames. Some parts of MediaWiki use the '#' to make "fake" users (Especially the blocking code), but that's not relavent in this context. ---- at the beginning of a line generates an <hr>. Urls cause all sorts of weird stuff to happen (But not inside a link). So do things like __TOC__, and magic links (RFC123) if they are enabled.


TASK DETAIL
https://phabricator.wikimedia.org/T182800

EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Bawolff
Cc: gerritbot, Bawolff, Lucas_Werkmeister_WMDE, Aklapper, Cpaulf30, Lahi, Gq86, Baloch007, Lordiis, GoranSMilovanovic, Adik2382, Th3d3v1ls, Ramalepe, Liugev6, QZanden, Lewizho99, Maathavan, Wikidata-bugs, aude, Mbch331
_______________________________________________
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to