From f9ba9a380264224957e649dbfe584bfe85327e59 Mon Sep 17 00:00:00 2001 From: westi Date: Fri, 25 Jan 2008 18:50:52 +0000 Subject: [PATCH] Allow IPv6 addresses as well. Fixes #4579 props pishmishy. git-svn-id: http://svn.automattic.com/wordpress/trunk@6658 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/comment.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/comment.php b/wp-includes/comment.php index c0a390cc8f..e1cef1e25d 100644 --- a/wp-includes/comment.php +++ b/wp-includes/comment.php @@ -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) )