Last modified: 2011-03-13 18:06:44 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 T3661, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 1661 - <br clear=(all|left|right|none)> breaks XHTML compilance
<br clear=(all|left|right|none)> breaks XHTML compilance
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
Other All
: Lowest blocker with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
: parser, patch
Depends on:
  Show dependency treegraph
Reported: 2005-03-08 18:24 UTC by Ævar Arnfjörð Bjarmason
Modified: 2011-03-13 18:06 UTC (History)
0 users

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

The patch against includes/Parser.php (723 bytes, patch)
2005-03-08 18:25 UTC, Ævar Arnfjörð Bjarmason
The patch against includes/Parser.php (for REL1_4) (736 bytes, patch)
2005-03-08 18:29 UTC, Ævar Arnfjörð Bjarmason
A testcase for the regular expression (509 bytes, text/plain)
2005-03-08 18:32 UTC, Ævar Arnfjörð Bjarmason

Description Ævar Arnfjörð Bjarmason 2005-03-08 18:24:06 UTC
using <br clear=all> breaks XHTML compilance. This patch fixes the issue.
Comment 1 Ævar Arnfjörð Bjarmason 2005-03-08 18:25:24 UTC
Created attachment 352 [details]
The patch against includes/Parser.php

A patch for HEAD.
Comment 2 Ævar Arnfjörð Bjarmason 2005-03-08 18:29:24 UTC
Created attachment 353 [details]
The patch against includes/Parser.php (for REL1_4)

The patch against REL1_4.
Comment 3 Ævar Arnfjörð Bjarmason 2005-03-08 18:32:50 UTC
Created attachment 354 [details]
A testcase for the regular expression

A testcase for the expression.
Comment 4 Brion Vibber 2005-03-08 22:13:40 UTC
Several things wrong with this patch:

First, it does not appear to be notice-clean. With error_reporting set to E_ALL, 
notices will be displayed about the use of undefined constants.

Second, it will fail to pick up any <br> containing additional attributes (for 
instance, an id or a style attribute) so it is insufficient. 

Third, it gratuitously transforms the clear attribute to an inline style. This is 
unnecessary for our XHTML 1.0 Transitional target. (If it were necessary, it would 
also be necessary to be able to merge it with a specified style attribute if present.)

Consider instead working on Sanitizer.php to have the HTML sanitizer output the 
/> automatically on manditorily-closed empty elements.
Comment 5 Ævar Arnfjörð Bjarmason 2005-03-08 22:33:27 UTC
1. It isn't, I didn't test it for that.

2. No it won't, it was designed for this specific case and you're right, it's

3. This is what currently happens if you type <br clear="both"/>, the wiki will
render <br style="clear: both;" />, however if you type <br clear="all" /> or
<br clear="all"> it will output what you gave it.

4. Sanitizer.php is probably better, any suggestions as to where to start?

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