diff --git a/wp-includes/comment.php b/wp-includes/comment.php
index 5e89ef7..89628aa 100644
|
a
|
b
|
function wp_new_comment( $commentdata, $avoid_die = false ) {
|
| 2098 | 2098 | return $commentdata['comment_approved']; |
| 2099 | 2099 | } |
| 2100 | 2100 | |
| | 2101 | $check_max_lengths = wp_check_comment_data_max_lengths( $commentdata ); |
| | 2102 | if ( is_wp_error( $check_max_lengths ) ) { |
| | 2103 | if ( true === $avoid_die ) { |
| | 2104 | return $check_max_lengths; |
| | 2105 | } else { |
| | 2106 | if ( wp_doing_ajax() ) { |
| | 2107 | die( $check_max_lengths->get_error_message() ); |
| | 2108 | } |
| | 2109 | |
| | 2110 | wp_die( $check_max_lengths->get_error_message(), $check_max_lengths->get_error_code() ); |
| | 2111 | } |
| | 2112 | } |
| | 2113 | |
| 2101 | 2114 | $comment_ID = wp_insert_comment( $commentdata ); |
| 2102 | 2115 | if ( ! $comment_ID ) { |
| 2103 | 2116 | $fields = array( 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content' ); |