Sanitize proxy IP check.

git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4224 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2006-09-25 01:45:29 +00:00
parent 96b3fea74d
commit 277349165b

View File

@ -683,6 +683,7 @@ function wp_blacklist_check($author, $email, $url, $comment, $user_ip, $user_age
function wp_proxy_check($ipnum) {
if ( get_option('open_proxy_check') && isset($ipnum) ) {
$ipnum = preg_replace( '/([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}).*/', '$1', $ipnum );
$rev_ip = implode( '.', array_reverse( explode( '.', $ipnum ) ) );
$lookup = $rev_ip . '.sbl-xbl.spamhaus.org.';
if ( $lookup != gethostbyname( $lookup ) )