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

git-svn-id: http://svn.automattic.com/wordpress/trunk@6658 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
westi 2008-01-25 18:50:52 +00:00
parent 2e8ee3b0e0
commit f9ba9a3802

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) )