Make WordPress Core

Ticket #3028: proxy_check.diff

File proxy_check.diff, 636 bytes (added by westi, 19 years ago)

Fix the proxy check preg_replace to capture the whole IP

  • functions.php

     
    10121012
    10131013function wp_proxy_check($ipnum) {
    10141014        if ( get_option('open_proxy_check') && isset($ipnum) ) {
    1015                 $ipnum = preg_replace( '/([0-9]{1,3})\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}).*/', '$1', $ipnum );
     1015                $ipnum = preg_replace( '/([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}).*/', '$1', $ipnum );
    10161016                $rev_ip = implode( '.', array_reverse( explode( '.', $ipnum ) ) );
    10171017                $lookup = $rev_ip . '.sbl-xbl.spamhaus.org.';
    10181018                if ( $lookup != gethostbyname( $lookup ) )