Ticket #12529: 12529.001.diff
File 12529.001.diff, 1.6 KB (added by , 15 years ago) |
---|
-
wp-comments-post.php
30 30 31 31 if ( !comments_open($comment_post_ID) ) { 32 32 do_action('comment_closed', $comment_post_ID); 33 wp_die( __('Sorry, comments are closed for this item.') );33 wp_die( __('Sorry, comments are closed for this item.'), '', array( 'response' => 403 ) ); 34 34 } elseif ( 'trash' == $status->post_status ) { 35 35 do_action('comment_on_trash', $comment_post_ID); 36 36 exit; … … 65 65 } 66 66 } else { 67 67 if ( get_option('comment_registration') || 'private' == $status->post_status ) 68 wp_die( __('Sorry, you must be logged in to post a comment.') );68 wp_die( __('Sorry, you must be logged in to post a comment.'), '', array( 'response' => 401 ) ); 69 69 } 70 70 71 71 $comment_type = ''; 72 72 73 73 if ( get_option('require_name_email') && !$user->ID ) { 74 74 if ( 6 > strlen($comment_author_email) || '' == $comment_author ) 75 wp_die( __('Error: please fill the required fields (name, email).') );75 wp_die( __('Error: please fill the required fields (name, email).'), '', array( 'response' => 200 ) ); 76 76 elseif ( !is_email($comment_author_email)) 77 wp_die( __('Error: please enter a valid email address.') );77 wp_die( __('Error: please enter a valid email address.'), '', array( 'response' => 200 ) ); 78 78 } 79 79 80 80 if ( '' == $comment_content ) 81 wp_die( __('Error: please type a comment.') );81 wp_die( __('Error: please type a comment.'), '', array( 'response' => 200 ) ); 82 82 83 83 $comment_parent = isset($_POST['comment_parent']) ? absint($_POST['comment_parent']) : 0; 84 84