Make WordPress Core

Ticket #11333: 11333.diff

File 11333.diff, 2.3 KB (added by solarissmoke, 15 years ago)
  • wp-comments-post.php

     
    2626        exit;
    2727} elseif ( !comments_open($comment_post_ID) ) {
    2828        do_action('comment_closed', $comment_post_ID);
    29         wp_die( __('Sorry, comments are closed for this item.') );
     29        wp_die( __('Sorry, comments are closed for this item.'), '', array('response' => 403) );
    3030} elseif ( in_array($status->post_status, array('draft', 'pending') ) ) {
    3131        do_action('comment_on_draft', $comment_post_ID);
    3232        exit;
     
    5858        }
    5959} else {
    6060        if ( get_option('comment_registration') || 'private' == $status->post_status )
    61                 wp_die( __('Sorry, you must be logged in to post a comment.') );
     61                wp_die( __('Sorry, you must be logged in to post a comment.'), '', array('response' => 403) );
    6262}
    6363
    6464$comment_type = '';
    6565
    6666if ( get_option('require_name_email') && !$user->ID ) {
    6767        if ( 6 > strlen($comment_author_email) || '' == $comment_author )
    68                 wp_die( __('Error: please fill the required fields (name, email).') );
     68                wp_die( __('Error: please fill the required fields (name, email).'), '', array('response' => 403) );
    6969        elseif ( !is_email($comment_author_email))
    70                 wp_die( __('Error: please enter a valid email address.') );
     70                wp_die( __('Error: please enter a valid email address.'), '', array('response' => 403) );
    7171}
    7272
    7373if ( '' == $comment_content )
    74         wp_die( __('Error: please type a comment.') );
     74        wp_die( __('Error: please type a comment.'), '', array('response' => 403) );
    7575
    7676$comment_parent = isset($_POST['comment_parent']) ? absint($_POST['comment_parent']) : 0;
    7777
  • wp-includes/comment.php

     
    501501                if ( defined('DOING_AJAX') )
    502502                        die( __('Duplicate comment detected; it looks as though you’ve already said that!') );
    503503
    504                 wp_die( __('Duplicate comment detected; it looks as though you’ve already said that!') );
     504                wp_die( __('Duplicate comment detected; it looks as though you’ve already said that!'), '', array('response' => 403) );
    505505        }
    506506
    507507        do_action( 'check_comment_flood', $comment_author_IP, $comment_author_email, $comment_date_gmt );