Ticket #38808: 38808-invalid.patch
File 38808-invalid.patch, 2.5 KB (added by , 9 years ago) |
---|
-
wp-includes/rest-api.php
1040 1040 switch ( $args['format'] ) { 1041 1041 case 'date-time' : 1042 1042 if ( ! rest_parse_date( $value ) ) { 1043 return new WP_Error( 'rest_invalid_date', __( ' The date you provided is invalid.' ) );1043 return new WP_Error( 'rest_invalid_date', __( 'Invalid date.' ) ); 1044 1044 } 1045 1045 break; 1046 1046 … … 1050 1050 // 1051 1051 // https://core.trac.wordpress.org/ticket/38506 1052 1052 if ( ! is_email( $value ) || strlen( $value ) < 6 ) { 1053 return new WP_Error( 'rest_invalid_email', __( ' The email address you provided is invalid.' ) );1053 return new WP_Error( 'rest_invalid_email', __( 'Invalid email address.' ) ); 1054 1054 } 1055 1055 break; 1056 1056 case 'ipv4' : 1057 1057 if ( ! rest_is_ip_address( $value ) ) { 1058 1058 /* translators: %s: IP address */ 1059 return new WP_Error( 'rest_invalid_param', sprintf( __( '%s is not a valid IP address.' ), $value) );1059 return new WP_Error( 'rest_invalid_param', __( 'Invalid IP address.' ) ); 1060 1060 } 1061 1061 break; 1062 1062 } -
wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
964 964 $user_obj = get_userdata( $post_author ); 965 965 966 966 if ( ! $user_obj ) { 967 return new WP_Error( 'rest_invalid_author', __( 'Invalid author id.' ), array( 'status' => 400 ) );967 return new WP_Error( 'rest_invalid_author', __( 'Invalid author ID.' ), array( 'status' => 400 ) ); 968 968 } 969 969 } 970 970 -
wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php
543 543 } 544 544 545 545 if ( email_exists( $request['email'] ) && $request['email'] !== $user->user_email ) { 546 return new WP_Error( 'rest_user_invalid_email', __( ' Email address is invalid.' ), array( 'status' => 400 ) );546 return new WP_Error( 'rest_user_invalid_email', __( 'Invalid email address.' ), array( 'status' => 400 ) ); 547 547 } 548 548 549 549 if ( ! empty( $request['username'] ) && $request['username'] !== $user->user_login ) {