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

Daniel Friesen <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mediawiki-bugs@nadir-seen-f
                   |                            |ire.com

--- Comment #4 from Daniel Friesen <[email protected]> ---
HTML5 has nothing to do with this. Of course HTML5 does not support
self-closing `<span />`, that's XML. Such a feature has never existed in HTML
and it's stupid to consider that HTML5 would change that when browsers have
never supported that in HTML.

This is of course completely irrelevant to the bug report. Because besides this
being an issue with the sanitizer and not the browser's HTML parser <img> IS a
void tag and the browser parser would treat <img /> the same way as <img>.

----

Now for the bug, testing this myself:

> $extraInclude = array( 'a', 'img' );

> $text = '<img src="http://example.com/test.png";>';
> var_dump( Sanitizer::removeHTMLtags( $text, null, array(), $extraInclude ) );
string(50) "<img src="http&#58;//example.com/test.png"></img>\n"

> $text = '<img src="http://example.com/test.png"; />';
> var_dump( Sanitizer::removeHTMLtags( $text, null, array(), $extraInclude ) );
string(47) "&lt;img src="http://example.com/test.png"; /&gt;"

I see that the real issue is we simply have no real support for void tags.
Since none of the tags we usually whitelist are void tags. We'll have to add
support for that to the sanitizer.

In the non-void case I think that the /> behaviour is probably correct. We
don't support self closing <div />'s. And turning <div /> into <div> like the
HTML parser does is unexpected to the user. The sanest behaviour is to
completely reject it so the user clearly can see something is wrong.

-- 
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