mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-03-24 07:14:28 +00:00
Clean up how we address IP addresses throughout the code
git-svn-id: https://develop.svn.wordpress.org/trunk@3990 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -321,7 +321,7 @@ function wp_insert_comment($commentdata) {
|
||||
extract($commentdata);
|
||||
|
||||
if ( ! isset($comment_author_IP) )
|
||||
$comment_author_IP = $_SERVER['REMOTE_ADDR'];
|
||||
$comment_author_IP = preg_replace( '/[^0-9., ]/', '',$_SERVER['REMOTE_ADDR'] );
|
||||
if ( ! isset($comment_date) )
|
||||
$comment_date = current_time('mysql');
|
||||
if ( ! isset($comment_date_gmt) )
|
||||
@@ -365,7 +365,7 @@ function wp_new_comment( $commentdata ) {
|
||||
$commentdata['comment_post_ID'] = (int) $commentdata['comment_post_ID'];
|
||||
$commentdata['user_ID'] = (int) $commentdata['user_ID'];
|
||||
|
||||
$commentdata['comment_author_IP'] = $_SERVER['REMOTE_ADDR'];
|
||||
$commentdata['comment_author_IP'] = preg_replace( '/[^0-9., ]/', '',$_SERVER['REMOTE_ADDR'] );
|
||||
$commentdata['comment_agent'] = $_SERVER['HTTP_USER_AGENT'];
|
||||
|
||||
$commentdata['comment_date'] = current_time('mysql');
|
||||
|
||||
Reference in New Issue
Block a user