Make WordPress Core

Changeset 25149


Ignore:
Timestamp:
08/28/2013 04:53:41 AM (11 years ago)
Author:
dd32
Message:

WP_HTTP: More relaxed host matching for WP_PROXY_BYPASS_HOSTS and WP_ACCESSIBLE_HOSTS, allowing for subdomains in wildcards to include dashes (and anything else which [\w.] didn't catch). Fixes #24201

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-http.php

    r25114 r25149  
    556556                $wildcard_regex = array();
    557557                foreach ( $accessible_hosts as $host )
    558                     $wildcard_regex[] = str_replace('\*', '[\w.]+?', preg_quote($host, '/'));
     558                    $wildcard_regex[] = str_replace( '\*', '.+', preg_quote( $host, '/' ) );
    559559                $wildcard_regex = '/^(' . implode('|', $wildcard_regex) . ')$/i';
    560560            }
     
    16221622                $wildcard_regex = array();
    16231623                foreach ( $bypass_hosts as $host )
    1624                     $wildcard_regex[] = str_replace('\*', '[\w.]+?', preg_quote($host, '/'));
     1624                    $wildcard_regex[] = str_replace( '\*', '.+', preg_quote( $host, '/' ) );
    16251625                $wildcard_regex = '/^(' . implode('|', $wildcard_regex) . ')$/i';
    16261626            }
Note: See TracChangeset for help on using the changeset viewer.