diff --git src/wp-comments-post.php src/wp-comments-post.php
index 0ed359c..a5cb0f5 100644
|
|
if ( ! comments_open( $comment_post_ID ) ) { |
47 | 47 | * @param int $comment_post_ID Post ID. |
48 | 48 | */ |
49 | 49 | do_action( 'comment_closed', $comment_post_ID ); |
50 | | wp_die( __('Sorry, comments are closed for this item.') ); |
| 50 | wp_die( __('Sorry, comments are closed for this item.'), '', array( 'response' => 403 ) ); |
51 | 51 | } elseif ( 'trash' == $status ) { |
52 | 52 | /** |
53 | 53 | * Fires when a comment is attempted on a trashed post. |
… |
… |
if ( $user->exists() ) { |
112 | 112 | } |
113 | 113 | } else { |
114 | 114 | if ( get_option('comment_registration') || 'private' == $status ) |
115 | | wp_die( __('Sorry, you must be logged in to post a comment.') ); |
| 115 | wp_die( __('Sorry, you must be logged in to post a comment.'), '', array( 'response' => 403 ) ); |
116 | 116 | } |
117 | 117 | |
118 | 118 | $comment_type = ''; |
119 | 119 | |
120 | 120 | if ( get_option('require_name_email') && !$user->exists() ) { |
121 | 121 | if ( 6 > strlen($comment_author_email) || '' == $comment_author ) |
122 | | wp_die( __('<strong>ERROR</strong>: please fill the required fields (name, email).') ); |
| 122 | wp_die( __('<strong>ERROR</strong>: please fill the required fields (name, email).'), '', array( 'response' => 200 ) ); |
123 | 123 | elseif ( !is_email($comment_author_email)) |
124 | | wp_die( __('<strong>ERROR</strong>: please enter a valid email address.') ); |
| 124 | wp_die( __('<strong>ERROR</strong>: please enter a valid email address.'), '', array( 'response' => 200 ) ); |
125 | 125 | } |
126 | 126 | |
127 | 127 | if ( '' == $comment_content ) |
128 | | wp_die( __('<strong>ERROR</strong>: please type a comment.') ); |
| 128 | wp_die( __('<strong>ERROR</strong>: please type a comment.'), '', array( 'response' => 200 ) ); |
129 | 129 | |
130 | 130 | $comment_parent = isset($_POST['comment_parent']) ? absint($_POST['comment_parent']) : 0; |
131 | 131 | |
diff --git src/wp-includes/comment.php src/wp-includes/comment.php
index a4cc7e2..fed94df 100644
|
|
function wp_allow_comment( $commentdata ) { |
843 | 843 | if ( defined( 'DOING_AJAX' ) ) { |
844 | 844 | die( __('Duplicate comment detected; it looks as though you’ve already said that!') ); |
845 | 845 | } |
846 | | wp_die( __('Duplicate comment detected; it looks as though you’ve already said that!') ); |
| 846 | wp_die( __('Duplicate comment detected; it looks as though you’ve already said that!'), '', array('response' => 409) ); |
847 | 847 | } |
848 | 848 | |
849 | 849 | /** |
… |
… |
function check_comment_flood_db( $ip, $email, $date ) { |
960 | 960 | if ( defined('DOING_AJAX') ) |
961 | 961 | die( __('You are posting comments too quickly. Slow down.') ); |
962 | 962 | |
963 | | wp_die( __('You are posting comments too quickly. Slow down.'), '', array('response' => 403) ); |
| 963 | wp_die( __('You are posting comments too quickly. Slow down.'), '', array('response' => 429) ); |
964 | 964 | } |
965 | 965 | } |
966 | 966 | } |