diff --git wp-includes/comment.php wp-includes/comment.php
index d3d8db6..270cafa 100644
|
|
|
function wp_new_comment( $commentdata ) { |
| 1384 | 1384 | $parent_status = ( 0 < $commentdata['comment_parent'] ) ? wp_get_comment_status($commentdata['comment_parent']) : ''; |
| 1385 | 1385 | $commentdata['comment_parent'] = ( 'approved' == $parent_status || 'unapproved' == $parent_status ) ? $commentdata['comment_parent'] : 0; |
| 1386 | 1386 | |
| 1387 | | $commentdata['comment_author_IP'] = preg_replace( '/[^0-9a-fA-F:., ]/', '',$_SERVER['REMOTE_ADDR'] ); |
| 1388 | | $commentdata['comment_agent'] = isset( $_SERVER['HTTP_USER_AGENT'] ) ? substr( $_SERVER['HTTP_USER_AGENT'], 0, 254 ) : ''; |
| 1389 | | |
| 1390 | | $commentdata['comment_date'] = current_time('mysql'); |
| 1391 | | $commentdata['comment_date_gmt'] = current_time('mysql', 1); |
| | 1387 | if ( ! isset( $commentdata['comment_author_IP'] ) ) |
| | 1388 | $commentdata['comment_author_IP'] = preg_replace( '/[^0-9a-fA-F:., ]/', '',$_SERVER['REMOTE_ADDR'] ); |
| | 1389 | if ( ! isset( $commentdata['comment_agent'] ) ) |
| | 1390 | $commentdata['comment_agent'] = isset( $_SERVER['HTTP_USER_AGENT'] ) ? substr( $_SERVER['HTTP_USER_AGENT'], 0, 254 ) : ''; |
| | 1391 | |
| | 1392 | if ( ! isset( $commentdata['comment_date'] ) ) |
| | 1393 | $commentdata['comment_date'] = current_time( 'mysql' ); |
| | 1394 | if ( ! isset( $commentdata['comment_date_gmt'] ) ) |
| | 1395 | $commentdata['comment_date_gmt'] = current_time( 'mysql', 1 ); |
| 1392 | 1396 | |
| 1393 | 1397 | $commentdata = wp_filter_comment($commentdata); |
| 1394 | 1398 | |