diff --git a/src/wp-includes/pluggable.php b/src/wp-includes/pluggable.php index 3b65e45089..7c38b6d67b 100644 --- a/src/wp-includes/pluggable.php +++ b/src/wp-includes/pluggable.php @@ -1349,7 +1349,6 @@ function wp_validate_redirect($location, $default = '') { } $wpp = parse_url(home_url()); - $site = parse_url( site_url() ); /** * Filter the whitelist of hosts to redirect to. @@ -1359,9 +1358,9 @@ function wp_validate_redirect($location, $default = '') { * @param array $hosts An array of allowed hosts. * @param bool|string $host The parsed host; empty if not isset. */ - $allowed_hosts = (array) apply_filters( 'allowed_redirect_hosts', array( $wpp['host'], $site['host'] ), isset( $lp['host'] ) ? $lp['host'] : '' ); + $allowed_hosts = (array) apply_filters( 'allowed_redirect_hosts', array($wpp['host']), isset($lp['host']) ? $lp['host'] : '' ); - if ( isset($lp['host']) && ( ! in_array( $lp['host'], $allowed_hosts ) && ( $lp['host'] != strtolower( $wpp['host'] ) || $lp['host'] != strtolower( $site['host'] ) ) ) ) + if ( isset($lp['host']) && ( !in_array($lp['host'], $allowed_hosts) && $lp['host'] != strtolower($wpp['host'])) ) $location = $default; return $location; @@ -2484,3 +2483,4 @@ function wp_text_diff( $left_string, $right_string, $args = null ) { return $r; } endif; +