From 4239e6ef01ef399c2ce416bd8262dc504a633523 Mon Sep 17 00:00:00 2001 From: Ron Rennick Date: Fri, 15 Jan 2010 18:02:34 +0000 Subject: [PATCH] fix multisite object cache warnings, $table_prefix assignment, See #11644 git-svn-id: https://develop.svn.wordpress.org/trunk@12730 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/ms-functions.php | 4 ++-- wp-includes/ms-load.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-includes/ms-functions.php b/wp-includes/ms-functions.php index ee385c70e3..5f3f15ed8b 100644 --- a/wp-includes/ms-functions.php +++ b/wp-includes/ms-functions.php @@ -308,7 +308,7 @@ function switch_to_blog( $new_blog ) { if ( is_object( $current_user ) ) $current_user->_init_caps(); - if ( is_object( $wp_object_cache ) ) + if ( is_object( $wp_object_cache ) && isset( $wp_object_cache->global_groups ) ) $global_groups = $wp_object_cache->global_groups; else $global_groups = false; @@ -361,7 +361,7 @@ function restore_current_blog() { if ( is_object( $current_user ) ) $current_user->_init_caps(); - if ( is_object( $wp_object_cache ) ) + if ( is_object( $wp_object_cache ) && isset( $wp_object_cache->global_groups ) ) $global_groups = $wp_object_cache->global_groups; else $global_groups = false; diff --git a/wp-includes/ms-load.php b/wp-includes/ms-load.php index efdcb96b53..11b4ffa48c 100644 --- a/wp-includes/ms-load.php +++ b/wp-includes/ms-load.php @@ -17,7 +17,7 @@ if( defined( 'SUNRISE' ) ) $wpdb->blogid = $current_blog->blog_id; $wpdb->siteid = $current_blog->site_id; $wpdb->set_prefix($table_prefix); // set up blog tables -$table_prefix = $table_prefix . $blog_id . '_'; +$table_prefix = $wpdb->get_blog_prefix(); // Fix empty PHP_SELF $PHP_SELF = $_SERVER['PHP_SELF'];