mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-10 18:37:58 +01:00
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:
parent
caabc52753
commit
d6a5c68516
@ -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;
|
||||
|
@ -4,7 +4,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.7-beta2-39157';
|
||||
$wp_version = '4.7-beta2-39158';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user