Make WordPress Core

Ticket #15591: ms-settings.php.diff

File ms-settings.php.diff, 997 bytes (added by mwidmann, 14 years ago)
  • wp-includes/ms-settings.php

     
    5959                        if ( $current_blog )
    6060                                wp_cache_set( 'current_blog_' . $domain, $current_blog, 'site-options' );
    6161                }
    62                 if ( $current_blog && $current_blog->site_id != $current_site->id )
     62                if ( $current_blog && $current_blog->site_id != $current_site->id ) {
    6363                        $current_site = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->site WHERE id = %d", $current_blog->site_id ) );
    64                 else
     64                        if ( ! isset( $current_site->blog_id ) )
     65                                $current_site->blog_id = $wpdb->get_var( $wpdb->prepare( "SELECT blog_id FROM $wpdb->blogs WHERE domain = %s AND path = %s", $current_site->domain, $current_site->path ) );
     66                } else
    6567                        $blogname = substr( $domain, 0, strpos( $domain, '.' ) );
    6668        } else {
    6769                $blogname = htmlspecialchars( substr( $_SERVER[ 'REQUEST_URI' ], strlen( $path ) ) );