From 7c63edeccec6b0b0d06a49d9e2bde6f17e925048 Mon Sep 17 00:00:00 2001 From: Happy-melon Date: Wed, 30 Sep 2009 09:46:48 +0000 Subject: [PATCH] Recommit r56947, partially overwritten in r57024. --- includes/HTMLForm.php | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/includes/HTMLForm.php b/includes/HTMLForm.php index 65948f39be..fc6ae9980f 100644 --- a/includes/HTMLForm.php +++ b/includes/HTMLForm.php @@ -852,11 +852,14 @@ class HTMLTextField extends HTMLFormField { $attribs[$param] = ''; } } + } - # Implement tiny differences between some field variants - # here, rather than creating a new class for each one which - # is essentially just a clone of this one. - if ( isset( $this->mParams['type'] ) ) { + # Implement tiny differences between some field variants + # here, rather than creating a new class for each one which + # is essentially just a clone of this one. + if ( isset( $this->mParams['type'] ) ) { + # Options that apply only to HTML5 + if( $wgHtml5 ){ switch ( $this->mParams['type'] ) { case 'email': $attribs['type'] = 'email'; @@ -868,11 +871,14 @@ class HTMLTextField extends HTMLFormField { $attribs['type'] = 'number'; $attribs['step'] = 'any'; break; - case 'password': - $attribs['type'] = 'password'; - break; } } + # Options that apply to HTML4 as well + switch( $this->mParams['type'] ){ + case 'password': + $attribs['type'] = 'password'; + break; + } } return Html::element( 'input', $attribs ); -- 2.20.1