Make WordPress Core


Ignore:
Timestamp:
05/14/2017 04:19:51 AM (7 years ago)
Author:
rachelbaker
Message:

Formatting: Increase minimum characters allowed in is_email() to 6.

Brings the minimum characters expected for a valid email address to six, which matches the expectations in wp_handle_comment_submission() and REST API email arguments.

Props rmccue, lukecavanagh, rachelbaker, desrosj, sudar.
Fixes #38708.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api.php

    r40600 r40667  
    10781078
    10791079            case 'email' :
    1080                 // is_email() checks for 3 characters (a@b), but
    1081                 // wp_handle_comment_submission() requires 6 characters (a@b.co)
    1082                 //
    1083                 // https://core.trac.wordpress.org/ticket/38506
    1084                 if ( ! is_email( $value ) || strlen( $value ) < 6 ) {
     1080                if ( ! is_email( $value ) ) {
    10851081                    return new WP_Error( 'rest_invalid_email', __( 'Invalid email address.' ) );
    10861082                }
Note: See TracChangeset for help on using the changeset viewer.