| @@ -14,13 +14,8 @@ | ||
| 14 | 14 | */ |
| 15 | 15 | protected $type = 'email'; |
| 16 | 16 | |
| 17 | 17 | /** |
| 18 | - * @var string | |
| 19 | - */ | |
| 20 | - protected $display_type = 'text'; | |
| 21 | - | |
| 22 | - /** | |
| 23 | 18 | * @var bool |
| 24 | 19 | * @since 3.0 |
| 25 | 20 | */ |
| 26 | 21 | protected $holds_email_values = true; |
| @@ -48,13 +43,15 @@ | ||
| 48 | 43 | * |
| 49 | 44 | * @return array |
| 50 | 45 | */ |
| 51 | 46 | public function validate( $args ) { |
| 47 | + if ( ! $args['value'] ) { | |
| 48 | + return array(); | |
| 49 | + } | |
| 52 | 50 | $errors = array(); |
| 53 | - if ( $args['value'] != '' && ! is_email( $args['value'] ) ) { | |
| 51 | + if ( false !== strpos( $args['value'], '.@' ) || ! is_email( $args['value'] ) ) { | |
| 54 | 52 | $errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $this->field, 'invalid' ); |
| 55 | 53 | } |
| 56 | - | |
| 57 | 54 | return $errors; |
| 58 | 55 | } |
| 59 | 56 | |
| 60 | 57 | /** |