From: robin Date: Mon, 17 Sep 2012 01:27:50 +0000 (+0200) Subject: Maintenance in Html::openElement regarding input types X-Git-Tag: 1.31.0-rc.0~22357 X-Git-Url: http://git.cyclocoop.org/url?a=commitdiff_plain;h=5a59d9b8bb83a84c9f2254a740c321b643966459;p=lhc%2Fweb%2Fwiklou.git Maintenance in Html::openElement regarding input types Followup to c22000 Remove unset() for 'search' type, it will now simply be unset through the regular checking (removed it in the validTypes for that, but it is still in validTypes in HTML5 mode). Update / remove outdated code comments. Change-Id: I452462b81360b67b76dd8baa732d52113b6aafe6 --- diff --git a/includes/Html.php b/includes/Html.php index 83af24aff3..dfd081f25f 100644 --- a/includes/Html.php +++ b/includes/Html.php @@ -191,12 +191,8 @@ class Html { return ''; } - # Remove HTML5-only attributes if we aren't doing HTML5, and disable - # form validation regardless (see bug 23769 and the more detailed - # comment in expandAttributes()) + # Remove invalid input types if ( $element == 'input' ) { - # Whitelist of types that don't cause validation. All except - # 'search' are valid in XHTML1. $validTypes = array( 'hidden', 'text', @@ -208,9 +204,9 @@ class Html { 'image', 'reset', 'button', - 'search', ); + # Allow more input types in HTML5 mode if( $wgHtml5 ) { $validTypes = array_merge( $validTypes, array( 'datetime', @@ -232,11 +228,6 @@ class Html { && !in_array( $attribs['type'], $validTypes ) ) { unset( $attribs['type'] ); } - - if ( isset( $attribs['type'] ) && $attribs['type'] == 'search' - && !$wgHtml5 ) { - unset( $attribs['type'] ); - } } if ( !$wgHtml5 && $element == 'textarea' && isset( $attribs['maxlength'] ) ) {