This corrects a regression reported with some fancy templated tables at
http://en.wikipedia.org/wiki/Wikipedia:WikiProject_Chemicals/Organization
* Copy IRC-over-UDP update option from REL1_4
* (bug 2548) Keep summary on 'show changes' of section edit
* Move center on toc to title part to avoid breaking .toc style usage
+* HTML sanitizer: correct multiple attributes by keeping last, not first
=== Caveats ===
'/(' . URL_PROTOCOLS . '):/',
'\\1:', $value );
- if( !isset( $attribs[$attribute] ) ) {
- $attribs[$attribute] = "$attribute=\"$value\"";
- }
+ // If this attribute was previously set, override it.
+ // Output should only have one attribute of each name.
+ $attribs[$attribute] = "$attribute=\"$value\"";
}
if( empty( $attribs ) ) {
return '';
!! input
<div align="center" align="right">HTML rocks</div>
!! result
-<div align="center">HTML rocks</div>
+<div align="right">HTML rocks</div>
+
+!!end
+
+!! test
+HTML multiple attributes correction
+!! input
+<p class="error" class="awesome">Awesome!</p>
+!! result
+<p class="awesome">Awesome!</p>
+
+!!end
+
+!! test
+Table multiple attributes correction
+!! input
+{|
+!+ class="error" class="awesome"| status
+|}
+!! result
+<table>
+<tr>
+<th class="awesome">status</th>
+</tr>
+</table>
!!end