WordPress.org

Make WordPress Core

Ticket #17376: 17376.5.diff

File 17376.5.diff, 1.0 KB (added by nacin, 8 years ago)
  • src/wp-includes/ms-settings.php

     
    119119                $current_blog->blog_id = $blog_id = 1;
    120120        }
    121121
     122        // Admin access must have an exact path match.
     123        if ( ! empty( $current_blog ) && is_admin() && 0 !== strcasecmp( $current_blog->path, $path ) ) {
     124                $scheme = is_ssl() ? 'https' : 'http';
     125                header( "Location: $scheme://{$current_blog->domain}{$current_blog->path}" );
     126                exit;
     127        }
     128
    122129        // No site has been found, bail.
    123130        if ( empty( $current_blog ) ) {
    124131                // We're going to redirect to the network URL, with some possible modifications.
     
    149156                        if ( '%siteurl%' !== NOBLOGREDIRECT ) {
    150157                                $destination = NOBLOGREDIRECT;
    151158                        }
     159                } elseif ( is_admin() ) {
     160                        $destination .= 'wp-admin/';
    152161                } elseif ( 0 === strcasecmp( $current_site->domain, $domain ) ) {
    153162                        /*
    154163                         * If the domain we were searching for matches the network's domain,