From f8e3be14fef9b8383110228854789626942fe363 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Wed, 28 Aug 2013 04:54:09 +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 Built from https://develop.svn.wordpress.org/trunk@25149 git-svn-id: http://core.svn.wordpress.org/trunk@25128 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-http.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/class-http.php b/wp-includes/class-http.php index 459f9a8366..0c57ccc906 100644 --- a/wp-includes/class-http.php +++ b/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'; } }