From 4f410dc9f3ab6540ce9c478f0e12b4fe8a7bf5a3 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Wed, 28 Aug 2013 04:53:41 +0000 Subject: [PATCH] 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 --- src/wp-includes/class-http.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/class-http.php b/src/wp-includes/class-http.php index 459f9a8366..0c57ccc906 100644 --- a/src/wp-includes/class-http.php +++ b/src/wp-includes/class-http.php @@ -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'; } }