Last modified: 2014-10-22 04:50:22 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 65747 - Sanitizer::removeHTMLtags doesn't close tags correctly when $wgUseTidy is enabled
Sanitizer::removeHTMLtags doesn't close tags correctly when $wgUseTidy is ena...
Status: NEW
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
Depends on:
Blocks: tidy
  Show dependency treegraph
Reported: 2014-05-25 19:55 UTC by Jackmcbarn
Modified: 2014-10-22 04:50 UTC (History)
2 users (show)

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

Strange formatting after using double unclosed table tags (90.74 KB, image/png)
2014-10-22 04:50 UTC, Mr. Stradivarius

Description Jackmcbarn 2014-05-25 19:55:51 UTC

Comment 1 Jackmcbarn 2014-05-25 19:56:51 UTC
(hmm, why did this submit early?)

When a construct such as {{DISPLAYTITLE:<b>Foo bar<b>}} is used, the unbalanced tags leak and affect the rest of the page, as well as MediaWiki's interface.
Comment 2 Florian 2014-05-26 13:10:42 UTC
Maybe an extension problem on wikipedia? I have tested on a clean 1.24wmf5 version without anything and AllowDisplayTitle=true and RestrictDisplayTitle=false, but if i use displytitle parser hook in te same format like given (unclosed b-tag) i become only the plain title without bold (it's written bold, if i close the tag correctly). So, on a fresh mediawiki installation i can not reproduce this error (correct me, if i does everything false :)).
Comment 3 Jackmcbarn 2014-05-26 17:05:47 UTC
I've tracked this problem down to Sanitizer::removeHTMLtags and $wgUseTidy. When $wgUseTidy is disabled (as it is on default MediaWiki installations), calling Sanitizer::removeHTMLtags on "<b>test<b>" correctly yields "<b>test&lt;b&gt;</b>". However, when it is enabled, calling it on "<b>test<b>" yields "<b>test<b>" back unchanged, which is incorrect and the cause of this bug.
Comment 4 Mr. Stradivarius 2014-10-22 04:48:24 UTC
Related to this, I've found that if you save the page with the following code on enwiki, it results in some very strange formatting:

<table> <table>Some text

(The whitespace appears to be important.)

See for an example. You might need to try the link a few times; it appears to be an intermittent behaviour. Additionally, if this code is used on preview, it sometimes causes the input to be lost. I've opened bug 72343 about this.
Comment 5 Mr. Stradivarius 2014-10-22 04:50:22 UTC
Created attachment 16838 [details]
Strange formatting after using double unclosed table tags

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