Index: trunk/phase3/includes/HTMLForm.php |
— | — | @@ -1078,7 +1078,7 @@ |
1079 | 1079 | |
1080 | 1080 | # http://dev.w3.org/html5/spec/common-microsyntaxes.html#real-numbers |
1081 | 1081 | # with the addition that a leading '+' sign is ok. |
1082 | | - if ( !preg_match( '/^(\+|\-)?\d+(\.\d+)?(E(\+|\-)?\d+)?$/i', $value ) ) { |
| 1082 | + if ( !preg_match( '/^((\+|\-)?\d+(\.\d+)?(E(\+|\-)?\d+)?)?$/i', $value ) ) { |
1083 | 1083 | return wfMsgExt( 'htmlform-float-invalid', 'parse' ); |
1084 | 1084 | } |
1085 | 1085 | |
— | — | @@ -1121,7 +1121,7 @@ |
1122 | 1122 | # phone numbers when you know that they are integers (the HTML5 type=tel |
1123 | 1123 | # input does not require its value to be numeric). If you want a tidier |
1124 | 1124 | # value to, eg, save in the DB, clean it up with intval(). |
1125 | | - if ( !preg_match( '/^(\+|\-)?\d*$/', trim( $value ) ) |
| 1125 | + if ( !preg_match( '/^((\+|\-)?\d+)?$/', trim( $value ) ) |
1126 | 1126 | ) { |
1127 | 1127 | return wfMsgExt( 'htmlform-int-invalid', 'parse' ); |
1128 | 1128 | } |