WordPress.org

Make WordPress Core

Ticket #4011: 4011.spelling.diff

File 4011.spelling.diff, 2.1 KB (added by jbsil, 9 years ago)

Changes to $accessible_hosts and WP_ACCESSIBLE_HOSTS in http.php

  • http.php

     
    506506         *
    507507         * You block external URL requests by defining WP_HTTP_BLOCK_EXTERNAL in your wp-config.php file
    508508         * and this will only allow localhost and your blog to make requests. The constant
    509          * WP_ACCESSABLE_HOSTS will allow additional hosts to go through for requests. The format of the
    510          * WP_ACCESSABLE_HOSTS constant is a comma separated list of hostnames to allow.
     509         * WP_ACCESSIBLE_HOSTS will allow additional hosts to go through for requests. The format of the
     510         * WP_ACCESSIBLE_HOSTS constant is a comma separated list of hostnames to allow.
    511511         *
    512512         * @since 2.8.0
    513513         * @link http://core.trac.wordpress.org/ticket/8927 Allow preventing external requests.
     
    540540                if ( $check['host'] == 'localhost' || $check['host'] == $home['host'] )
    541541                        return apply_filters('block_local_requests', false);
    542542
    543                 if ( !defined('WP_ACCESSABLE_HOSTS') )
     543                if ( !defined('WP_ACCESSIBLE_HOSTS') )
    544544                        return true;
    545545
    546                 static $accessable_hosts;
    547                 if ( null == $accessable_hosts )
    548                         $accessable_hosts = preg_split('|,\s*|', WP_ACCESSABLE_HOSTS);
     546                static $accessible_hosts;
     547                if ( null == $accessible_hosts )
     548                        $accessible_hosts = preg_split('|,\s*|', WP_ACCESSIBLE_HOSTS);
    549549
    550                 return !in_array( $check['host'], $accessable_hosts ); //Inverse logic, If its in the array, then we can't access it.
     550                return !in_array( $check['host'], $accessible_hosts ); //Inverse logic, If its in the array, then we can't access it.
    551551        }
    552552}
    553553
     
    12481248                                curl_setopt( $handle, CURLOPT_PROXYUSERPWD, $proxy->authentication() );
    12491249                        }
    12501250                }
    1251                
     1251
    12521252                $is_local = isset($args['local']) && $args['local'];
    12531253                $ssl_verify = isset($args['sslverify']) && $args['sslverify'];
    12541254                if ( $is_local )
     
    15221522
    15231523                if ( !defined('WP_PROXY_BYPASS_HOSTS') )
    15241524                        return true;
    1525                
     1525
    15261526                static $bypass_hosts;
    15271527                if ( null == $bypass_hosts )
    15281528                        $bypass_hosts = preg_split('|,\s*|', WP_PROXY_BYPASS_HOSTS);
    1529                
     1529
    15301530                return !in_array( $check['host'], $bypass_hosts );
    15311531        }
    15321532}