https://bugzilla.wikimedia.org/show_bug.cgi?id=44525

--- Comment #7 from Krinkle <[email protected]> ---
Actually, I think those bugs might be related. The one you refer looks like it
was implicitly fixed in clean up I did in Ifbeae7e9.

The jqueryMsg parser only supports very basic wikitext (external links, local
links and some other basic syntax) and i18n parser functions (plural, gender,
grammer). Everything else is not understood and as such considered text nodes
and must NOT be used in interface messages parsed in jqueryMsg.

Before Ifbeae7e9, if the text node contained "<" it was parsed as arbitrary
HTML. Which broke some special characters and hyperlinks that contained &amp;.
Hence I fixed that.

However, It was actually much worse than the above. jqueryMsg didn't check for
"<" (that would've been a sloppy implementation with shady intentions), it was
just passing it to jQuery's .append() with comment "// strings and numbers".
jqueryMsg was intending to appending as text nodes, no html parsing of any
kind.

However in jQuery append> domManip> buildFragment> test> rhtml
> rhtml = /<|&#?\w+;/

There, buildFragment decides to parse html or append text node based on some
regex...


Messages are not allowed to contain arbitrary html. Everything is plain text
unless wikitext supports it (and in this case, the subset of that supported in
jqueryMsg). Right that subset is i18n parser functions and wikilinks.

Ifbeae7e9 removed the insecure and unreliable coincidence factor that would
sometimes parse any arbitrary html – unfiltered.

If you need certain html tags such as <br> (i.e. the ones allowed in wikitext),
they'll have to be properly supported and implemented in jqueryMsg. Otherwise,
avoid those kind of tags in those messages.

Suggesting to close as wontfix, invalid or worksforme.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to