Ticket #11286: 11286.diff
File 11286.diff, 2.7 KB (added by , 10 years ago) |
---|
-
src/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.' ), 403 ); 51 51 } elseif ( 'trash' == $status ) { 52 52 /** 53 53 * Fires when a comment is attempted on a trashed post. … … 111 111 } 112 112 } 113 113 } else { 114 if ( get_option('comment_registration') || 'private' == $status ) 115 wp_die( __('Sorry, you must be logged in to post a comment.') ); 114 if ( get_option( 'comment_registration' ) || 'private' == $status ) { 115 wp_die( __( 'Sorry, you must be logged in to post a comment.' ), 403 ); 116 } 116 117 } 117 118 118 119 $comment_type = ''; 119 120 120 121 if ( get_option('require_name_email') && !$user->exists() ) { 121 if ( 6 > strlen($comment_author_email) || '' == $comment_author ) 122 wp_die( __('<strong>ERROR</strong>: please fill the required fields (name, email).') ); 123 elseif ( !is_email($comment_author_email)) 124 wp_die( __('<strong>ERROR</strong>: please enter a valid email address.') ); 122 if ( 6 > strlen( $comment_author_email ) || '' == $comment_author ) { 123 wp_die( __( '<strong>ERROR</strong>: please fill the required fields (name, email).' ), 200 ); 124 } else if ( ! is_email( $comment_author_email ) ) { 125 wp_die( __( '<strong>ERROR</strong>: please enter a valid email address.' ), 200 ); 126 } 125 127 } 126 128 127 if ( '' == $comment_content ) 128 wp_die( __('<strong>ERROR</strong>: please type a comment.') ); 129 if ( '' == $comment_content ) { 130 wp_die( __( '<strong>ERROR</strong>: please type a comment.' ), 200 ); 131 } 129 132 130 133 $comment_parent = isset($_POST['comment_parent']) ? absint($_POST['comment_parent']) : 0; 131 134 -
src/wp-includes/comment.php
1127 1127 if ( defined( 'DOING_AJAX' ) ) { 1128 1128 die( __('Duplicate comment detected; it looks as though you’ve already said that!') ); 1129 1129 } 1130 wp_die( __( 'Duplicate comment detected; it looks as though you’ve already said that!'));1130 wp_die( __( 'Duplicate comment detected; it looks as though you’ve already said that!' ), 409 ); 1131 1131 } 1132 1132 1133 1133 /** … … 1245 1245 if ( defined('DOING_AJAX') ) 1246 1246 die( __('You are posting comments too quickly. Slow down.') ); 1247 1247 1248 wp_die( __( 'You are posting comments too quickly. Slow down.'), '', array('response' => 403));1248 wp_die( __( 'You are posting comments too quickly. Slow down.' ), 429 ); 1249 1249 } 1250 1250 } 1251 1251 }