Allow IPv6 addresses as well. Fixes #4579 props pishmishy.

git-svn-id: https://develop.svn.wordpress.org/trunk@6658 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Peter Westwood 2008-01-25 18:50:52 +00:00
parent 9125d102d4
commit 0db02d1e0d
1 changed files with 1 additions and 1 deletions

View File

@ -552,7 +552,7 @@ function wp_insert_comment($commentdata) {
extract($commentdata, EXTR_SKIP);
if ( ! isset($comment_author_IP) )
$comment_author_IP = preg_replace( '/[^0-9., ]/', '',$_SERVER['REMOTE_ADDR'] );
$comment_author_IP = preg_replace( '/[^0-9a-fA-F:., ]/', '',$_SERVER['REMOTE_ADDR'] );
if ( ! isset($comment_date) )
$comment_date = current_time('mysql');
if ( ! isset($comment_date_gmt) )