Make WordPress Core

Ticket #58168: 58168.patch

File 58168.patch, 670 bytes (added by ravipatel, 2 years ago)

Edit comment form validation

  • src/wp-admin/includes/comment.php

     
    5555                wp_die( __( 'Sorry, you are not allowed to edit comments on this post.' ) );
    5656        }
    5757
     58        if ( '' === $_POST['content'] ) {
     59                wp_die( __( 'Please type your comment text.' ) );
     60        }
     61
    5862        if ( isset( $_POST['newcomment_author'] ) ) {
    5963                $_POST['comment_author'] = $_POST['newcomment_author'];
    6064        }
     
    134138        return $comment;
    135139}
    136140
    137 /**
     141/**`
    138142 * Gets the number of pending comments on a post or posts.
    139143 *
    140144 * @since 2.3.0