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
git-svn-id: https://develop.svn.wordpress.org/trunk@25149 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
022e5c2227
commit
4f410dc9f3
@ -555,7 +555,7 @@ class WP_Http {
|
||||
if ( false !== strpos(WP_ACCESSIBLE_HOSTS, '*') ) {
|
||||
$wildcard_regex = array();
|
||||
foreach ( $accessible_hosts as $host )
|
||||
$wildcard_regex[] = str_replace('\*', '[\w.]+?', preg_quote($host, '/'));
|
||||
$wildcard_regex[] = str_replace( '\*', '.+', preg_quote( $host, '/' ) );
|
||||
$wildcard_regex = '/^(' . implode('|', $wildcard_regex) . ')$/i';
|
||||
}
|
||||
}
|
||||
@ -1621,7 +1621,7 @@ class WP_HTTP_Proxy {
|
||||
if ( false !== strpos(WP_PROXY_BYPASS_HOSTS, '*') ) {
|
||||
$wildcard_regex = array();
|
||||
foreach ( $bypass_hosts as $host )
|
||||
$wildcard_regex[] = str_replace('\*', '[\w.]+?', preg_quote($host, '/'));
|
||||
$wildcard_regex[] = str_replace( '\*', '.+', preg_quote( $host, '/' ) );
|
||||
$wildcard_regex = '/^(' . implode('|', $wildcard_regex) . ')$/i';
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user