mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-05 02:10:45 +01:00
Workaround PHP parse_url() bug. Props azaozz. fixes #7288
git-svn-id: http://svn.automattic.com/wordpress/trunk@8324 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
4846338eeb
commit
8750ed2ea1
@ -827,7 +827,10 @@ function wp_safe_redirect($location, $status = 302) {
|
|||||||
if ( substr($location, 0, 2) == '//' )
|
if ( substr($location, 0, 2) == '//' )
|
||||||
$location = 'http:' . $location;
|
$location = 'http:' . $location;
|
||||||
|
|
||||||
$lp = parse_url($location);
|
// In php 5 parse_url may fail if the URL query part contains http://, bug #38143
|
||||||
|
$test = ( $cut = strpos($location, '?') ) ? substr( $location, 0, $cut ) : $location;
|
||||||
|
|
||||||
|
$lp = parse_url($test);
|
||||||
$wpp = parse_url(get_option('home'));
|
$wpp = parse_url(get_option('home'));
|
||||||
|
|
||||||
$allowed_hosts = (array) apply_filters('allowed_redirect_hosts', array($wpp['host']), isset($lp['host']) ? $lp['host'] : '');
|
$allowed_hosts = (array) apply_filters('allowed_redirect_hosts', array($wpp['host']), isset($lp['host']) ? $lp['host'] : '');
|
||||||
|
Loading…
Reference in New Issue
Block a user