Ticket #14601: 14601.diff
File 14601.diff, 1.5 KB (added by , 11 years ago) |
---|
-
wp-includes/comment.php
1387 1387 $parent_status = ( 0 < $commentdata['comment_parent'] ) ? wp_get_comment_status($commentdata['comment_parent']) : ''; 1388 1388 $commentdata['comment_parent'] = ( 'approved' == $parent_status || 'unapproved' == $parent_status ) ? $commentdata['comment_parent'] : 0; 1389 1389 1390 $commentdata['comment_author_IP'] = preg_replace( '/[^0-9a-fA-F:., ]/', '',$_SERVER['REMOTE_ADDR'] );1391 $commentdata['comment_agent'] = substr($_SERVER['HTTP_USER_AGENT'], 0, 254);1390 if ( ! isset( $commentdata['comment_author_IP'] ) ) 1391 $commentdata['comment_author_IP'] = $_SERVER['REMOTE_ADDR']; 1392 1392 1393 $commentdata['comment_date'] = current_time('mysql'); 1394 $commentdata['comment_date_gmt'] = current_time('mysql', 1); 1393 $commentdata['comment_author_IP'] = preg_replace( '/[^0-9a-fA-F:., ]/', '', $commentdata['comment_author_IP'] ); 1395 1394 1395 if ( ! isset( $commentdata['comment_agent'] ) ) 1396 $commentdata['comment_agent'] = $_SERVER['HTTP_USER_AGENT']; 1397 1398 $commentdata['comment_agent'] = substr( $commentdata['comment_agent'], 0, 254 ); 1399 1400 if ( ! isset( $commentdata['comment_date'] ) ) 1401 $commentdata['comment_date'] = current_time('mysql'); 1402 1403 if ( ! isset( $commentdata['comment_date_gmt'] ) ) 1404 $commentdata['comment_date_gmt'] = current_time('mysql', 1); 1405 1396 1406 $commentdata = wp_filter_comment($commentdata); 1397 1407 1398 1408 $commentdata['comment_approved'] = wp_allow_comment($commentdata);