Make WordPress Core

Ticket #39650: 39650.5.patch

File 39650.5.patch, 2.2 KB (added by sagarprajapati, 9 years ago)
  • wp-comments-post.php

     
    2828        if ( ! empty( $data ) ) {
    2929                wp_die( '<p>' . $comment->get_error_message() . '</p>', __( 'Comment Submission Failure' ), array( 'response' => $data, 'back_link' => true ) );
    3030        } else {
    31                 exit;
     31                wp_die( '<p>' . $comment->get_error_message() . '</p>', __( 'Comment Submission Failure' ), array( 'back_link' => true ) );
    3232        }
    3333}
    3434
  • wp-includes/comment.php

     
    29562956                 */
    29572957                do_action( 'comment_id_not_found', $comment_post_ID );
    29582958
    2959                 return new WP_Error( 'comment_id_not_found' );
     2959                return new WP_Error( 'comment_id_not_found', __( 'Sorry, comments are not allowed for this item.' ), 403 );
    29602960
    29612961        }
    29622962
     
    29642964        $status = get_post_status( $post );
    29652965
    29662966        if ( ( 'private' == $status ) && ! current_user_can( 'read_post', $comment_post_ID ) ) {
    2967                 return new WP_Error( 'comment_id_not_found' );
     2967                return new WP_Error( 'comment_id_not_found', __( 'Sorry, comments are not allowed for this item.' ), 403 );
    29682968        }
    29692969
    29702970        $status_obj = get_post_status_object( $status );
     
    29932993                 */
    29942994                do_action( 'comment_on_trash', $comment_post_ID );
    29952995
    2996                 return new WP_Error( 'comment_on_trash' );
     2996                return new WP_Error( 'comment_on_trash', __( 'Sorry, comments are not allowed for this item.' ), 403 );
    29972997
    29982998        } elseif ( ! $status_obj->public && ! $status_obj->private ) {
    29992999
     
    30063006                 */
    30073007                do_action( 'comment_on_draft', $comment_post_ID );
    30083008
    3009                 return new WP_Error( 'comment_on_draft' );
     3009                return new WP_Error( 'comment_on_draft', __( 'Sorry, comments are not allowed for this item.' ), 403 );
    30103010
    30113011        } elseif ( post_password_required( $comment_post_ID ) ) {
    30123012
     
    30193019                 */
    30203020                do_action( 'comment_on_password_protected', $comment_post_ID );
    30213021
    3022                 return new WP_Error( 'comment_on_password_protected' );
     3022                return new WP_Error( 'comment_on_password_protected', __( 'Sorry, comments are not allowed for this item.' ), 403 );
    30233023
    30243024        } else {
    30253025