always call set_blog_id after blog lookup, See #11644

git-svn-id: http://svn.automattic.com/wordpress/trunk@13421 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
wpmuguru 2010-02-26 00:05:11 +00:00
parent c7aa32c0ac
commit 4dc6a43f96

View File

@ -16,8 +16,7 @@ require( ABSPATH . WPINC . '/ms-default-constants.php' );
if ( defined( 'SUNRISE' ) )
include_once( WP_CONTENT_DIR . '/sunrise.php' );
if ( isset( $current_site ) && isset( $current_blog ) )
return;
if ( !isset( $current_site ) || !isset( $current_blog ) ) {
$domain = addslashes( $_SERVER['HTTP_HOST'] );
if ( false !== strpos( $domain, ':' ) ) {
@ -114,8 +113,8 @@ if ( ! $blog_id ) {
wp_die( __( 'No blog by that name on this system.' ) . $msg );
}
}
$wpdb->set_prefix( $table_prefix, false ); // set DB table prefix
}
$wpdb->set_prefix( $table_prefix, false ); // $table_prefix can be set in sunrise.php
$wpdb->set_blog_id( $current_blog->blog_id, $current_blog->site_id );
$table_prefix = $wpdb->get_blog_prefix();