mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-04 04:34:31 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@40667 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1077,11 +1077,7 @@ function rest_validate_value_from_schema( $value, $args, $param = '' ) {
|
||||
break;
|
||||
|
||||
case 'email' :
|
||||
// is_email() checks for 3 characters (a@b), but
|
||||
// wp_handle_comment_submission() requires 6 characters (a@b.co)
|
||||
//
|
||||
// https://core.trac.wordpress.org/ticket/38506
|
||||
if ( ! is_email( $value ) || strlen( $value ) < 6 ) {
|
||||
if ( ! is_email( $value ) ) {
|
||||
return new WP_Error( 'rest_invalid_email', __( 'Invalid email address.' ) );
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user