From 86e5a8a70d0312f5abff044c721a490423337eaf Mon Sep 17 00:00:00 2001 From: emc3 Date: Wed, 16 Feb 2005 21:35:58 +0000 Subject: [PATCH] This really deserves to be in a separate function so that plugins can get at it more easily, don't you think? git-svn-id: http://svn.automattic.com/wordpress/trunk@2357 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions-post.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/wp-includes/functions-post.php b/wp-includes/functions-post.php index 937015f223..56f583e7a0 100644 --- a/wp-includes/functions-post.php +++ b/wp-includes/functions-post.php @@ -438,8 +438,16 @@ function wp_blacklist_check($author, $email, $url, $comment, $user_ip, $user_age if ( preg_match($pattern, $user_agent) ) return true; } - if ( get_option('open_proxy_check') && isset($_SERVER['REMOTE_ADDR']) ) { - $rev_ip = implode( '.', array_reverse( explode( '.', $_SERVER['REMOTE_ADDR'] ) ) ); + if ( isset($_SERVER['REMOTE_ADDR']) ) { + if ( $wp_proxy_check($_SERVER['REMOTE_ADDR']) ) return true; + } + + return false; +} + +function wp_proxy_check($ipnum) { + if ( get_option('open_proxy_check') && isset($ipnum) ) { + $rev_ip = implode( '.', array_reverse( explode( '.', $ipnum ) ) ); $lookup = $rev_ip . '.opm.blitzed.org'; if ( $lookup != gethostbyname( $lookup ) ) return true;