Recommit r56947, partially overwritten in r57024.
authorHappy-melon <happy-melon@users.mediawiki.org>
Wed, 30 Sep 2009 09:46:48 +0000 (09:46 +0000)
committerHappy-melon <happy-melon@users.mediawiki.org>
Wed, 30 Sep 2009 09:46:48 +0000 (09:46 +0000)
includes/HTMLForm.php

index 65948f3..fc6ae99 100644 (file)
@@ -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 );