Index: trunk/phase3/includes/Html.php |
— | — | @@ -180,22 +180,6 @@ |
181 | 181 | if ( $element == 'textarea' && isset( $attribs['maxlength'] ) ) { |
182 | 182 | unset( $attribs['maxlength'] ); |
183 | 183 | } |
184 | | - # Here we're blacklisting some HTML5-only attributes... |
185 | | - $html5attribs = array( |
186 | | - 'autocomplete', |
187 | | - 'autofocus', |
188 | | - 'max', |
189 | | - 'min', |
190 | | - 'multiple', |
191 | | - 'pattern', |
192 | | - 'placeholder', |
193 | | - 'required', |
194 | | - 'step', |
195 | | - 'spellcheck', |
196 | | - ); |
197 | | - foreach ( $html5attribs as $badAttr ) { |
198 | | - unset( $attribs[$badAttr] ); |
199 | | - } |
200 | 184 | } |
201 | 185 | |
202 | 186 | return "<$element" . self::expandAttributes( |
— | — | @@ -381,6 +365,22 @@ |
382 | 366 | continue; |
383 | 367 | } |
384 | 368 | |
| 369 | + # Here we're blacklisting some HTML5-only attributes... |
| 370 | + if ( !$wgHtml5 && in_array( $key, array( |
| 371 | + 'autocomplete', |
| 372 | + 'autofocus', |
| 373 | + 'max', |
| 374 | + 'min', |
| 375 | + 'multiple', |
| 376 | + 'pattern', |
| 377 | + 'placeholder', |
| 378 | + 'required', |
| 379 | + 'step', |
| 380 | + 'spellcheck', |
| 381 | + ) ) ) { |
| 382 | + continue; |
| 383 | + } |
| 384 | + |
385 | 385 | # See the "Attributes" section in the HTML syntax part of HTML5, |
386 | 386 | # 9.1.2.3 as of 2009-08-10. Most attributes can have quotation |
387 | 387 | # marks omitted, but not all. (Although a literal " is not |