Check for urls that have a scheme but no host in wp_validate_redirect().

git-svn-id: https://develop.svn.wordpress.org/trunk@13878 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2010-03-29 16:47:17 +00:00
parent 580bd283fd
commit 0129bad3ef
1 changed files with 4 additions and 0 deletions

View File

@ -990,6 +990,10 @@ function wp_validate_redirect($location, $default = '') {
if ( isset($lp['scheme']) && !('http' == $lp['scheme'] || 'https' == $lp['scheme']) )
return $default;
// Reject if scheme is set but host is not. This catches urls like https:host.com for which parse_url does not set the host field.
if ( isset($lp['scheme']) && !isset($lp['host']) )
return $default;
$wpp = parse_url(home_url());
$allowed_hosts = (array) apply_filters('allowed_redirect_hosts', array($wpp['host']), isset($lp['host']) ? $lp['host'] : '');