WordPress.org

Make WordPress Core

Ticket #17376: 17376.3.diff

File 17376.3.diff, 1.4 KB (added by jeremyfelt, 8 years ago)
  • src/wp-includes/ms-load.php

     
    348348        // If persistent caching is enabled, we could query the DB for a path <> '/'
    349349        // then cache whether we can just always ignore paths.
    350350
    351         if ( count( $paths ) > 1 ) {
     351        // Look for all possible paths unless wp-admin is part of the request. At that
     352        // point, an exact match should be made from the first path segment tested.
     353        if ( count( $paths ) > 1  && ! is_admin() ) {
    352354                $paths = "'" . implode( "', '", $wpdb->_escape( $paths ) ) . "'";
    353355                $sql = $wpdb->prepare( "SELECT * FROM $wpdb->blogs WHERE domain = %s", $domain );
    354356                $sql .= " AND path IN ($paths) ORDER BY CHAR_LENGTH(path) DESC LIMIT 1";
  • src/wp-includes/ms-settings.php

     
    153153                        if ( 0 !== strcasecmp( $current_site->domain, $domain ) ) {
    154154                                header( 'Location: http://' . $current_site->domain . $current_site->path );
    155155                                exit;
     156                        } elseif ( is_admin() ) {
     157                                header( 'Location: http://' . $current_site->domain . $current_site->path . '/wp-admin' );
     158                                exit;
    156159                        }
    157160                        ms_not_installed();
    158161                }