WordPress.org

Make WordPress Core

Ticket #39133: 39133-1.diff

File 39133-1.diff, 731 bytes (added by PranaliPatel, 3 years ago)

As we are checking validation in is_email(), we can remove the string length check from the wp_handle_comment_submission().

  • src/wp-includes/comment.php

     
    30663066        $comment_type = '';
    30673067
    30683068        if ( get_option( 'require_name_email' ) && ! $user->exists() ) {
    3069                 if ( 6 > strlen( $comment_author_email ) || '' == $comment_author ) {
     3069                if ( '' == $comment_author ) {
    30703070                        return new WP_Error( 'require_name_email', __( '<strong>ERROR</strong>: please fill the required fields (name, email).' ), 200 );
    30713071                } elseif ( ! is_email( $comment_author_email ) ) {
    30723072                        return new WP_Error( 'require_valid_email', __( '<strong>ERROR</strong>: please enter a valid email address.' ), 200 );