diff --git a/src/wp-includes/comment.php b/src/wp-includes/comment.php
index 6c2f332893..70c64e19b0 100644
a
|
b
|
function wp_check_comment_data_max_lengths( $comment_data ) { |
1211 | 1211 | $max_lengths = wp_get_comment_fields_max_lengths(); |
1212 | 1212 | |
1213 | 1213 | if ( isset( $comment_data['comment_author'] ) && mb_strlen( $comment_data['comment_author'], '8bit' ) > $max_lengths['comment_author'] ) { |
1214 | | return new WP_Error( 'comment_author_column_length', __( '<strong>ERROR</strong>: your name is too long.' ), 200 ); |
| 1214 | return new WP_Error( 'comment_author_column_length', __( '<strong>ERROR</strong>: your name is too long.' ), 400 ); |
1215 | 1215 | } |
1216 | 1216 | |
1217 | 1217 | if ( isset( $comment_data['comment_author_email'] ) && strlen( $comment_data['comment_author_email'] ) > $max_lengths['comment_author_email'] ) { |
1218 | | return new WP_Error( 'comment_author_email_column_length', __( '<strong>ERROR</strong>: your email address is too long.' ), 200 ); |
| 1218 | return new WP_Error( 'comment_author_email_column_length', __( '<strong>ERROR</strong>: your email address is too long.' ), 400 ); |
1219 | 1219 | } |
1220 | 1220 | |
1221 | 1221 | if ( isset( $comment_data['comment_author_url'] ) && strlen( $comment_data['comment_author_url'] ) > $max_lengths['comment_author_url'] ) { |
1222 | | return new WP_Error( 'comment_author_url_column_length', __( '<strong>ERROR</strong>: your url is too long.' ), 200 ); |
| 1222 | return new WP_Error( 'comment_author_url_column_length', __( '<strong>ERROR</strong>: your url is too long.' ), 400 ); |
1223 | 1223 | } |
1224 | 1224 | |
1225 | 1225 | if ( isset( $comment_data['comment_content'] ) && mb_strlen( $comment_data['comment_content'], '8bit' ) > $max_lengths['comment_content'] ) { |
1226 | | return new WP_Error( 'comment_content_column_length', __( '<strong>ERROR</strong>: your comment is too long.' ), 200 ); |
| 1226 | return new WP_Error( 'comment_content_column_length', __( '<strong>ERROR</strong>: your comment is too long.' ), 400 ); |
1227 | 1227 | } |
1228 | 1228 | |
1229 | 1229 | return true; |
… |
… |
function wp_handle_comment_submission( $comment_data ) { |
3280 | 3280 | |
3281 | 3281 | if ( get_option( 'require_name_email' ) && ! $user->exists() ) { |
3282 | 3282 | if ( '' == $comment_author_email || '' == $comment_author ) { |
3283 | | return new WP_Error( 'require_name_email', __( '<strong>ERROR</strong>: please fill the required fields (name, email).' ), 200 ); |
| 3283 | return new WP_Error( 'require_name_email', __( '<strong>ERROR</strong>: please fill the required fields (name, email).' ), 400 ); |
3284 | 3284 | } elseif ( ! is_email( $comment_author_email ) ) { |
3285 | | return new WP_Error( 'require_valid_email', __( '<strong>ERROR</strong>: please enter a valid email address.' ), 200 ); |
| 3285 | return new WP_Error( 'require_valid_email', __( '<strong>ERROR</strong>: please enter a valid email address.' ), 400 ); |
3286 | 3286 | } |
3287 | 3287 | } |
3288 | 3288 | |
… |
… |
function wp_handle_comment_submission( $comment_data ) { |
3307 | 3307 | */ |
3308 | 3308 | $allow_empty_comment = apply_filters( 'allow_empty_comment', false, $commentdata ); |
3309 | 3309 | if ( '' === $comment_content && ! $allow_empty_comment ) { |
3310 | | return new WP_Error( 'require_valid_comment', __( '<strong>ERROR</strong>: please type a comment.' ), 200 ); |
| 3310 | return new WP_Error( 'require_valid_comment', __( '<strong>ERROR</strong>: please type a comment.' ), 400 ); |
3311 | 3311 | } |
3312 | 3312 | |
3313 | 3313 | $check_max_lengths = wp_check_comment_data_max_lengths( $commentdata ); |