Ticket #27248: comments-errors-400.diff
File comments-errors-400.diff, 1.7 KB (added by , 11 years ago) |
---|
-
wp-comments-post.php
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' => 400) ); 51 51 } elseif ( 'trash' == $status ) { 52 52 /** 53 53 * Fires when a comment is attempted on a trashed post. … … 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' => 400) ); 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' => 400) ); 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' => 400) ); 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' => 400) ); 129 129 130 130 $comment_parent = isset($_POST['comment_parent']) ? absint($_POST['comment_parent']) : 0; 131 131