[wp-trac] [WordPress Trac] #24201: Error in RegEx for proxy excluded URL in function send_through_proxy
WordPress Trac
noreply at wordpress.org
Fri Apr 26 13:13:37 UTC 2013
#24201: Error in RegEx for proxy excluded URL in function send_through_proxy
--------------------------+-----------------------------
Reporter: erich1978 | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: HTTP | Version: 3.5.1
Severity: normal | Keywords:
--------------------------+-----------------------------
Dear WordPress Team,
I've detected a bug in the function send_through_proxy in the class
WP_HTTP_Proxy. The coded regex for wildcarded domains only works for
subdomains containing characters (a-zA-Z0-9) and . (dot) but not for
subdomains containing characters (a-zA-Z0-9) and - (dash).
File: wp-includes/class-http.php around line 1411
Example:
define(WP_PROXY_BYPASS_HOSTS, '*.example.com');
foo.bar.example.com will not use proxy.
foo-bar.example.com will use proxy.
POSSIBLE SOLUTION:
Change the line 1411 from
$wildcard_regex[] = str_replace('\*', '[\w.]+?', preg_quote($host,
'/'));
to
$wildcard_regex[] = str_replace('\*', '[\w.-]+?', preg_quote($host,
'/'));
[[BR]]
Yours,
[[BR]]
Erich Lerch
--
Ticket URL: <http://core.trac.wordpress.org/ticket/24201>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list