Add is_multisite() check to wpdb::get_blog_prefix() to fix get_blog_prefix($blog_id) call on a non-MS install. See #11644

git-svn-id: http://svn.automattic.com/wordpress/trunk@13121 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2010-02-13 19:57:43 +00:00
parent 9316d29c1d
commit 12800b27fa
1 changed files with 5 additions and 6 deletions

View File

@ -489,12 +489,11 @@ class wpdb {
} }
function get_blog_prefix( $blog_id = '' ) { function get_blog_prefix( $blog_id = '' ) {
if ( $blog_id ) { if ( is_multisite() && $blog_id ) {
if( defined('MULTISITE') && ( $blog_id == 0 || $blog_id == 1) ) { if ( defined('MULTISITE') && ( $blog_id == 0 || $blog_id == 1 ) )
return $this->base_prefix; return $this->base_prefix;
} else { else
return $this->base_prefix . $blog_id . '_'; return $this->base_prefix . $blog_id . '_';
}
} else { } else {
return $this->base_prefix; return $this->base_prefix;
} }