REST API: Require 6 characters for comment email addresses.
The regular comments API requires 6 characters rather than 3, so we need to match this. Props mangeshp, dd32. Fixes #38506. Built from https://develop.svn.wordpress.org/trunk@39158 git-svn-id: http://core.svn.wordpress.org/trunk@39098 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -1036,7 +1036,11 @@ function rest_validate_value_from_schema( $value, $args, $param = '' ) {
|
||||
break;
|
||||
|
||||
case 'email' :
|
||||
if ( ! is_email( $value ) ) {
|
||||
// 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 ) {
|
||||
return new WP_Error( 'rest_invalid_email', __( 'The email address you provided is invalid.' ) );
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user