Changeset 30579
- Timestamp:
- 11/26/2014 08:16:47 PM (10 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-comments-post.php
r28672 r30579 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 /** … … 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 … … 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; -
trunk/src/wp-includes/comment.php
r30402 r30579 1132 1132 die( __('Duplicate comment detected; it looks as though you’ve already said that!') ); 1133 1133 } 1134 wp_die( __( 'Duplicate comment detected; it looks as though you’ve already said that!'));1134 wp_die( __( 'Duplicate comment detected; it looks as though you’ve already said that!' ), 409 ); 1135 1135 } 1136 1136 … … 1250 1250 die( __('You are posting comments too quickly. Slow down.') ); 1251 1251 1252 wp_die( __( 'You are posting comments too quickly. Slow down.'), '', array('response' => 403));1252 wp_die( __( 'You are posting comments too quickly. Slow down.' ), 429 ); 1253 1253 } 1254 1254 }
Note: See TracChangeset
for help on using the changeset viewer.