Make WordPress Core

Ticket #38808: 38808-invalid.patch

File 38808-invalid.patch, 2.5 KB (added by ramiy, 9 years ago)
  • wp-includes/rest-api.php

     
    10401040                switch ( $args['format'] ) {
    10411041                        case 'date-time' :
    10421042                                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.' ) );
    10441044                                }
    10451045                                break;
    10461046
     
    10501050                                //
    10511051                                // https://core.trac.wordpress.org/ticket/38506
    10521052                                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.' ) );
    10541054                                }
    10551055                                break;
    10561056                        case 'ipv4' :
    10571057                                if ( ! rest_is_ip_address( $value ) ) {
    10581058                                        /* 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.' ) );
    10601060                                }
    10611061                                break;
    10621062                }
  • wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php

     
    964964                                $user_obj = get_userdata( $post_author );
    965965
    966966                                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 ) );
    968968                                }
    969969                        }
    970970
  • wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php

     
    543543                }
    544544
    545545                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 ) );
    547547                }
    548548
    549549                if ( ! empty( $request['username'] ) && $request['username'] !== $user->user_login ) {