Make WordPress Core

Changeset 35792


Ignore:
Timestamp:
12/06/2015 09:16:12 PM (9 years ago)
Author:
aaroncampbell
Message:

Consider both home and site domains to be valid in wp_validate_redirect().

Props layotte.
Fixes #34028.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/pluggable.php

    r35735 r35792  
    13491349
    13501350    $wpp = parse_url(home_url());
     1351    $site = parse_url( site_url() );
    13511352
    13521353    /**
     
    13581359     * @param bool|string $host  The parsed host; empty if not isset.
    13591360     */
    1360     $allowed_hosts = (array) apply_filters( 'allowed_redirect_hosts', array($wpp['host']), isset($lp['host']) ? $lp['host'] : '' );
    1361 
    1362     if ( isset($lp['host']) && ( !in_array($lp['host'], $allowed_hosts) && $lp['host'] != strtolower($wpp['host'])) )
     1361    $allowed_hosts = (array) apply_filters( 'allowed_redirect_hosts', array( $wpp['host'], $site['host'] ), isset( $lp['host'] ) ? $lp['host'] : '' );
     1362
     1363    if ( isset($lp['host']) && ( ! in_array( $lp['host'], $allowed_hosts ) && ( $lp['host'] != strtolower( $wpp['host'] ) || $lp['host'] != strtolower( $site['host'] ) ) ) )
    13631364        $location = $default;
    13641365
     
    24812482}
    24822483endif;
    2483 
Note: See TracChangeset for help on using the changeset viewer.