Localisation updates from http://translatewiki.net.
[lhc/web/wiklou.git] / includes / Html.php
index 01dca6f..14456e4 100644 (file)
@@ -234,6 +234,13 @@ class Html {
                        unset( $attribs['maxlength'] );
                }
 
+               // According to standard the default type for <button> elements is "submit".
+               // Depending on compatibility mode IE might use "button", instead.
+               // We enforce the standard "submit".
+               if ( $element == 'button' && !isset( $attribs['type'] ) ) {
+                       $attribs['type'] = 'submit';
+               }
+
                return "<$element" . self::expandAttributes(
                        self::dropDefaults( $element, $attribs ) ) . '>';
        }
@@ -301,7 +308,6 @@ class Html {
                        'button' => array(
                                'formaction' => 'GET',
                                'formenctype' => 'application/x-www-form-urlencoded',
-                               'type' => 'submit',
                        ),
                        'canvas' => array(
                                'height' => '150',
@@ -470,7 +476,13 @@ class Html {
                        // server-side validation.  Opera is the only other implementation at
                        // this time, and has ugly UI, so just kill the feature entirely until
                        // we have at least one good implementation.
-                       if ( in_array( $key, array( 'max', 'min', 'pattern', 'required', 'step' ) ) ) {
+
+                       // As the default value of "1" for "step" rejects decimal
+                       // numbers to be entered in 'type="number"' fields, allow
+                       // the special case 'step="any"'.
+
+                       if ( in_array( $key, array( 'max', 'min', 'pattern', 'required' ) ) ||
+                                $key === 'step' && $value !== 'any' ) {
                                continue;
                        }