Last modified: 2011-03-13 18:06:44 UTC
using <br clear=all> breaks XHTML compilance. This patch fixes the issue.
Created attachment 352 [details] The patch against includes/Parser.php A patch for HEAD.
Created attachment 353 [details] The patch against includes/Parser.php (for REL1_4) The patch against REL1_4.
Created attachment 354 [details] A testcase for the regular expression A testcase for the expression.
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.
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 insufficient. 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?