From f922fc57d92a79f90d67997aef58b8928b67bd54 Mon Sep 17 00:00:00 2001 From: donncha Date: Tue, 2 Sep 2008 16:18:07 +0000 Subject: Check that we're not the "main blog" when deleting the current blog. Fixes #637 git-svn-id: http://svn.automattic.com/wordpress-mu/branches/2.6@1463 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- wp-includes/wpmu-functions.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/wp-includes/wpmu-functions.php b/wp-includes/wpmu-functions.php index 6f570bd..6d5227d 100644 --- a/wp-includes/wpmu-functions.php +++ b/wp-includes/wpmu-functions.php @@ -1700,7 +1700,9 @@ class delete_blog { } function admin_footer() { - global $wpdb; + global $wpdb, $current_blog, $current_site; + if( $current_blog->domain . $current_blog->path == $current_site->domain . $current_site->path ) + return false; if( $this->reallydeleteblog == true ) { wpmu_delete_blog( $wpdb->blogid ); @@ -1708,7 +1710,9 @@ class delete_blog { } function admin_menu() { - add_submenu_page('options-general.php', __('Delete Blog'), __('Delete Blog'), 'manage_options', 'delete-blog', array(&$this, 'plugin_content')); + global $current_blog, $current_site; + if( $current_blog->domain . $current_blog->path != $current_site->domain . $current_site->path ) + add_submenu_page('options-general.php', __('Delete Blog'), __('Delete Blog'), 'manage_options', 'delete-blog', array(&$this, 'plugin_content')); } function plugin_content() { -- cgit