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

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T67747, the corresponding Phabricator task for complete and up-to-date bug report information.
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)
1.24rc
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
https://en.wikipedia.org/wiki/User:Ja...
:
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: ---


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

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 https://en.wikipedia.org/w/index.php?title=User:Mr._Stradivarius/Sandbox&oldid=630607976 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.


Navigation
Links