Merge pull request #20913 from shoheitanaka/patch-15

If email @local include non alphabet
This commit is contained in:
Claudiu Lodromanean 2018-07-30 11:43:10 -07:00 committed by GitHub
commit 28f1aed9b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -697,9 +697,10 @@ class WC_Checkout {
}
if ( in_array( 'email', $format, true ) && '' !== $data[ $key ] ) {
$email_is_valid = is_email( $data[ $key ] );
$data[ $key ] = sanitize_email( $data[ $key ] );
if ( $validate_fieldset && ! is_email( $data[ $key ] ) ) {
if ( $validate_fieldset && ! $email_is_valid ) {
/* translators: %s: email address */
$errors->add( 'validation', sprintf( __( '%s is not a valid email address.', 'woocommerce' ), '<strong>' . esc_html( $field_label ) . '</strong>' ) );
continue;