Index: bp-activity.php
===================================================================
--- bp-activity.php	(revision 2867)
+++ bp-activity.php	(working copy)
@@ -7,11 +7,19 @@
 	global $bp, $wpdb, $current_blog;
 
 	if ( !defined( 'BP_ACTIVITY_SLUG' ) )
-		define ( 'BP_ACTIVITY_SLUG', $bp->pages->activity->slug );
+		if ( !empty( $bp->pages->activity->slug ) ) {
+			define ( 'BP_ACTIVITY_SLUG', $bp->pages->activity->slug );
+		} else {
+			define ( 'BP_ACTIVITY_SLUG', '' );
+		}
 
 	/* For internal identification */
 	$bp->activity->id = 'activity';
-	$bp->activity->name = $bp->pages->activity->name;
+	if ( !empty( $bp->pages->activity->name ) ) {
+		$bp->activity->name = $bp->pages->activity->name;
+	} else {
+		$bp->activity->name = '';
+	}
 	$bp->activity->slug = BP_ACTIVITY_SLUG;
 
 	$bp->activity->table_name = $wpdb->base_prefix . 'bp_activity';
Index: bp-core/bp-core-signup.php
===================================================================
--- bp-core/bp-core-signup.php	(revision 2867)
+++ bp-core/bp-core-signup.php	(working copy)
@@ -546,7 +546,7 @@
 
 /* Kill the wp-signup.php if custom registration signup templates are present */
 function bp_core_wpsignup_redirect() {
-	if ( false === strpos( $_SERVER['SCRIPT_NAME'], 'wp-signup.php') && $_GET['action'] != 'register' )
+	if ( false === strpos( $_SERVER['SCRIPT_NAME'], 'wp-signup.php') && (empty($_GET['action']) || $_GET['action'] != 'register') )
 		return false;
 
 	if ( locate_template( array( 'registration/register.php' ), false ) || locate_template( array( 'register.php' ), false ) )
Index: bp-core/bp-core-notifications.php
===================================================================
--- bp-core/bp-core-notifications.php	(revision 2867)
+++ bp-core/bp-core-notifications.php	(working copy)
@@ -46,7 +46,7 @@
 		$grouped_notifications[$notification->component_name][$notification->component_action][] = $notification;
 	}
 
-	if ( !$grouped_notifications )
+	if ( empty($grouped_notifications) )
 		return false;
 
 	/* Calculated a renderable outcome for each notification type */
Index: bp-core/admin/bp-core-upgrade.php
===================================================================
--- bp-core/admin/bp-core-upgrade.php	(revision 2867)
+++ bp-core/admin/bp-core-upgrade.php	(working copy)
@@ -640,7 +640,6 @@
 			<h2>Upgrade Complete!</h2>
 		<?php endif; ?>
 
-		<?php?>
 		<p><?php printf( __( "You've now completed all of the %s steps and BuddyPress is ready to be activated. Please hit the 'Finish &amp; Activate' button to complete the %s procedure.", 'buddypress' ), $type, $type ) ?></p>
 
 
@@ -677,6 +676,7 @@
 			check_admin_referer( 'bpwizard_components' );
 
 			// Settings form submitted, now save the settings.
+			$disabled = array();
 			foreach ( (array)$_POST['bp_components'] as $key => $value ) {
 				if ( !(int) $value )
 					$disabled[$key] = 1;
Index: bp-core/admin/bp-core-admin.php
===================================================================
--- bp-core/admin/bp-core-admin.php	(revision 2867)
+++ bp-core/admin/bp-core-admin.php	(working copy)
@@ -21,7 +21,7 @@
 }
 
 function bp_core_admin_settings() {
-	global $wpdb, $bp, $current_blog;
+	global $wpdb, $bp, $current_blog, $user_ID;
 ?>
 
 	<?php
@@ -45,6 +45,7 @@
 			update_site_option( $key, $value );
 		}
 	}
+	$ud = get_userdata($user_ID);
 	?>
 
 	<div class="wrap">
Index: bp-core/admin/bp-core-schema.php
===================================================================
--- bp-core/admin/bp-core-schema.php	(revision 2867)
+++ bp-core/admin/bp-core-schema.php	(working copy)
@@ -2,7 +2,7 @@
 function bp_core_set_charset() {
 	global $wpdb;
 
-	require_once( ABSPATH . 'wp-admin/upgrade-functions.php' );
+	require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
 
 	/* BuddyPress component DB schema */
 	if ( !empty($wpdb->charset) )
Index: bp-core/bp-core-adminbar.php
===================================================================
--- bp-core/bp-core-adminbar.php	(revision 2867)
+++ bp-core/bp-core-adminbar.php	(working copy)
@@ -6,7 +6,7 @@
 	if ( defined( 'BP_DISABLE_ADMIN_BAR' ) )
 		return false;
 
-	if ( (int)$bp->site_options['hide-loggedout-adminbar'] && !is_user_logged_in() )
+	if ( !empty($bp->site_options['hide-loggedout-adminbar']) && !is_user_logged_in() )
 		return false;
 
 	$bp->doing_admin_bar = true;
@@ -76,7 +76,11 @@
 
 			foreach( (array)$bp->bp_options_nav[$nav_item['slug']] as $subnav_item ) {
 				$link = str_replace( $bp->displayed_user->domain, $bp->loggedin_user->domain, $subnav_item['link'] );
-				$name = str_replace( $bp->displayed_user->userdata->user_login, $bp->loggedin_user->userdata->user_login, $subnav_item['name'] );
+				if ( !empty( $bp->displayed_user->userdata->user_login ) ) {
+					$name = str_replace( $bp->displayed_user->userdata->user_login, $bp->loggedin_user->userdata->user_login, $subnav_item['name'] );
+				} else {
+					$name = '';
+				}
 				$alt = ( 0 == $sub_counter % 2 ) ? ' class="alt"' : '';
 				echo '<li' . $alt . '><a id="bp-admin-' . $subnav_item['css_id'] . '" href="' . $link . '">' . $name . '</a></li>';
 				$sub_counter++;
Index: bp-core/bp-core-avatars.php
===================================================================
--- bp-core/bp-core-avatars.php	(revision 2867)
+++ bp-core/bp-core-avatars.php	(working copy)
@@ -32,7 +32,7 @@
 		define( 'BP_AVATAR_ORIGINAL_MAX_WIDTH', 450 );
 
 	if ( !defined( 'BP_AVATAR_ORIGINAL_MAX_FILESIZE' ) ) {
-		if ( !$bp->site_options['fileupload_maxk'] )
+		if ( empty($bp->site_options['fileupload_maxk']) )
 			define( 'BP_AVATAR_ORIGINAL_MAX_FILESIZE', 5120000 ); /* 5mb */
 		else
 			define( 'BP_AVATAR_ORIGINAL_MAX_FILESIZE', $bp->site_options['fileupload_maxk'] * 1024 );
Index: bp-core/bp-core-catchuri.php
===================================================================
--- bp-core/bp-core-catchuri.php	(revision 2867)
+++ bp-core/bp-core-catchuri.php	(working copy)
@@ -94,6 +94,10 @@
 	$bp_unfiltered_uri = $bp_uri;
 
 	/* Find a match within registered BuddyPress controlled WP pages (check members first) */
+	if (empty( $bp_pages )) {
+		return false;
+	}
+	$matches = array();
 	foreach ( (array)$bp_pages as $page_key => $bp_page ) {
 		if ( in_array( $bp_page->name, (array)$bp_uri ) ) {
 			/* Match found, now match the slug to make sure. */
@@ -120,7 +124,7 @@
 	}
 
 	/* This is not a BuddyPress page, so just return. */
-	if ( in_array( 0, (array) $matches ) )
+	if ( !$matches || in_array( 0, (array) $matches ) )
 		return false;
 
 	/* Find the offset */
Index: bp-xprofile/bp-xprofile-cssjs.php
===================================================================
--- bp-xprofile/bp-xprofile-cssjs.php	(revision 2867)
+++ bp-xprofile/bp-xprofile-cssjs.php	(working copy)
@@ -6,7 +6,7 @@
 add_action( 'admin_menu', 'xprofile_add_admin_css' );
 
 function xprofile_add_admin_js() {
-	if ( strpos( $_GET['page'], 'bp-profile-setup' ) !== false ) {
+	if ( !empty( $_GET['page'] ) && strpos( $_GET['page'], 'bp-profile-setup' ) !== false ) {
 		wp_enqueue_script( 'jquery-ui-sortable' );
 		wp_enqueue_script( 'xprofile-admin-js', BP_PLUGIN_URL . '/bp-xprofile/admin/js/admin.js', array( 'jquery', 'jquery-ui-sortable' ) );
 	}
Index: bp-xprofile/bp-xprofile-admin.php
===================================================================
--- bp-xprofile/bp-xprofile-admin.php	(revision 2867)
+++ bp-xprofile/bp-xprofile-admin.php	(working copy)
@@ -61,7 +61,7 @@
 			<div id="field-groups">
 <?php
 			if ( $groups ) :
-				foreach ( $groups as $group ) { ?>
+				foreach ( $groups as $j => $group ) { ?>
 
 						<table id="group_<?php echo $group->id; ?>" class="widefat field-group sortable">
 							<thead>
@@ -99,7 +99,7 @@
 							</tfoot>
 
 							<tbody id="<?php echo $group->id ?>">
- <?php 
+ <?php
 								if ( $group->fields ) :
 									foreach ( $group->fields as $field ) {
 										if ( 0 == $j % 2 )
@@ -141,7 +141,7 @@
 					<p>
 						<a class="button" href="admin.php?page=bp-profile-setup&amp;mode=add_group"><?php _e( 'Add New Field Group', 'buddypress' ); ?></a>
 					</p>
-<?php 
+<?php
 				else :
 ?>
 
Index: bp-xprofile/bp-xprofile-classes.php
===================================================================
--- bp-xprofile/bp-xprofile-classes.php	(revision 2867)
+++ bp-xprofile/bp-xprofile-classes.php	(working copy)
@@ -91,6 +91,7 @@
 		$r = wp_parse_args( $args, $defaults );
 		extract( $r, EXTR_SKIP );
 
+		$group_id_sql = '';
 		if ( $profile_group_id )
 			$group_id_sql = $wpdb->prepare( 'WHERE g.id = %d', $profile_group_id );
 
Index: bp-blogs.php
===================================================================
--- bp-blogs.php	(revision 2867)
+++ bp-blogs.php	(working copy)
@@ -10,11 +10,15 @@
 	global $bp, $wpdb;
 
 	if ( !defined( 'BP_BLOGS_SLUG' ) )
-		define ( 'BP_BLOGS_SLUG', $bp->pages->blogs->slug );
+		if (empty( $bp->pages->blogs ) ) {
+			define ( 'BP_BLOGS_SLUG', '' );
+		} else {
+			define ( 'BP_BLOGS_SLUG', $bp->pages->blogs->slug );
+			$bp->blogs->name = $bp->pages->blogs->name;
+		}
 
 	/* For internal identification */
 	$bp->blogs->id = 'blogs';
-	$bp->blogs->name = $bp->pages->blogs->name;
 	$bp->blogs->slug = BP_BLOGS_SLUG;
 
 	$bp->blogs->table_name = $wpdb->base_prefix . 'bp_user_blogs';
Index: bp-messages.php
===================================================================
--- bp-messages.php	(revision 2867)
+++ bp-messages.php	(working copy)
@@ -40,6 +40,9 @@
 	$messages_link = $bp->loggedin_user->domain . $bp->messages->slug . '/';
 
 	/* Add the subnav items to the profile */
+	if ( empty( $count_indicator ) ) {
+		$count_indicator = 0;
+	}
 	bp_core_new_subnav_item( array( 'name' => __( 'Inbox', 'buddypress' ) . $count_indicator, 'slug' => 'inbox', 'parent_url' => $messages_link, 'parent_slug' => $bp->messages->slug, 'screen_function' => 'messages_screen_inbox', 'position' => 10, 'user_has_access' => bp_is_my_profile() ) );
 	bp_core_new_subnav_item( array( 'name' => __( 'Sent Messages', 'buddypress' ), 'slug' => 'sentbox', 'parent_url' => $messages_link, 'parent_slug' => $bp->messages->slug, 'screen_function' => 'messages_screen_sentbox', 'position' => 20, 'user_has_access' => bp_is_my_profile() ) );
 	bp_core_new_subnav_item( array( 'name' => __( 'Compose', 'buddypress' ), 'slug' => 'compose', 'parent_url' => $messages_link, 'parent_slug' => $bp->messages->slug, 'screen_function' => 'messages_screen_compose', 'position' => 30, 'user_has_access' => bp_is_my_profile() ) );
Index: bp-forums.php
===================================================================
--- bp-forums.php	(revision 2867)
+++ bp-forums.php	(working copy)
@@ -13,11 +13,19 @@
 	global $bp;
 
 	if ( !defined( 'BP_FORUMS_SLUG' ) )
-		define ( 'BP_FORUMS_SLUG', $bp->pages->forums->slug );
+		if ( !empty( $bp->pages->forums->slug ) ) {
+			define ( 'BP_FORUMS_SLUG', $bp->pages->forums->slug );
+		} else {
+			define ( 'BP_FORUMS_SLUG', '' );
+		}
 
 	/* For internal identification */
 	$bp->forums->id = 'forums';
-	$bp->forums->name = $bp->pages->forums->name;
+	if ( !empty( $bp->pages->forums->name ) ) {
+		$bp->forums->name = $bp->pages->forums->name;
+	} else {
+		$bp->forums->name = '';
+	}
 	$bp->forums->slug = BP_FORUMS_SLUG;
 
 	$bp->forums->image_base = BP_PLUGIN_URL . '/bp-forums/images';
@@ -500,6 +508,10 @@
 function bp_forums_filter_caps( $allcaps ) {
 	global $bp, $wp_roles, $bb_table_prefix;
 
+	if ( empty( $bp->loggedin_user ) ) {
+		return $allcaps;
+	}
+
 	$bb_cap = get_usermeta( $bp->loggedin_user->id, $bb_table_prefix . 'capabilities' );
 
 	if ( empty( $bb_cap ) )
Index: bp-groups.php
===================================================================
--- bp-groups.php	(revision 2867)
+++ bp-groups.php	(working copy)
@@ -8,11 +8,19 @@
 	global $bp, $wpdb;
 
 	if ( !defined( 'BP_GROUPS_SLUG' ) )
-		define ( 'BP_GROUPS_SLUG', $bp->pages->groups->slug );
+		if ( !empty($bp->pages->groups->slug ) ) {
+			define ( 'BP_GROUPS_SLUG', $bp->pages->groups->slug );
+		} else {
+			define ( 'BP_GROUPS_SLUG', '' );
+		}
 
 	/* For internal identification */
 	$bp->groups->id = 'groups';
-	$bp->groups->name = $bp->pages->groups->name;
+	if ( !empty($bp->pages->groups->slug ) ) {
+		$bp->groups->name = $bp->pages->groups->name;
+	} else {
+		$bp->groups->name = '';
+	}
 	$bp->groups->slug = BP_GROUPS_SLUG;
 
 	$bp->groups->table_name = $wpdb->base_prefix . 'bp_groups';
@@ -142,7 +150,9 @@
 		}
 	}
 
-	do_action( 'groups_setup_nav', $bp->groups->current_group->user_has_access );
+	if ( !empty( $bp->groups->current_group->user_has_access  ) ) {
+		do_action( 'groups_setup_nav', $bp->groups->current_group->user_has_access );
+	}
 }
 add_action( 'bp_setup_nav', 'groups_setup_nav' );
 
@@ -161,7 +171,7 @@
 function groups_setup_adminbar_menu() {
 	global $bp;
 
-	if ( !$bp->groups->current_group )
+	if ( empty($bp->groups->current_group) )
 		return false;
 
 	/* Don't show this menu to non site admins or if you're viewing your own profile */
Index: bp-forums/bp-forums-bbpress.php
===================================================================
--- bp-forums/bp-forums-bbpress.php	(revision 2867)
+++ bp-forums/bp-forums-bbpress.php	(working copy)
@@ -65,7 +65,7 @@
 
 	/* This must be loaded before functionss.bb-admin.php otherwise we get a function conflict. */
 	if ( !$tables_installed = (boolean) $bbdb->get_results( 'DESCRIBE `' . $bbdb->forums . '`;', ARRAY_A ) )
-		require_once( ABSPATH . 'wp-admin/upgrade-functions.php' );
+		require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
 
 	require_once( BB_PATH . 'bb-admin/includes/functions.bb-admin.php' );
 
Index: bp-core.php
===================================================================
--- bp-core.php	(revision 2867)
+++ bp-core.php	(working copy)
@@ -7,7 +7,12 @@
  */
 define( 'BP_PLUGIN_DIR', WP_PLUGIN_DIR . '/buddypress' );
 define( 'BP_PLUGIN_URL', plugins_url( $path = '/buddypress' ) );
+define( 'BP_SEARCH_SLUG', 'definition missing' );
 
+if (!defined('VHOST')) {
+	define('VHOST', 'Obsolete Constant');
+}
+
 /* Load the WP abstraction file so BuddyPress can run on all WordPress setups. */
 require ( BP_PLUGIN_DIR . '/bp-core/bp-core-wpabstraction.php' );
 
@@ -83,7 +88,11 @@
 
 	/* Set up the members id and active components entry */
 	$bp->members->id = 'members';
-	$bp->members->slug = $bp->pages->members->slug;
+	if ( empty( $bp->pages->members->slug ) ) {
+		$bp->members->slug = '';
+	} else {
+		$bp->members->slug = $bp->pages->members->slug;
+	}
 	$bp->active_components[$bp->members->slug] = $bp->members->id;
 
 	/* The user ID of the user who is currently logged in. */
@@ -124,10 +133,13 @@
 
 	/* The default component to use if none are set and someone visits: http://domain.com/members/andy */
 	if ( !defined( 'BP_DEFAULT_COMPONENT' ) ) {
-		if ( isset( $bp->pages->activity ) )
+		if ( isset( $bp->pages->activity ) ) {
 			$bp->default_component = $bp->pages->activity->name;
-		else
+		} elseif ( !empty( $bp->pages->profile->name ) ) {
 			$bp->default_component = $bp->pages->profile->name;
+		} else {
+			$bp->default_component = '';
+		}
 	} else {
 		$bp->default_component = BP_DEFAULT_COMPONENT;
 	}
@@ -142,7 +154,7 @@
 	$bp->bp_options_nav = array();
 
 	/* Fetches the default Gravatar image to use if the user/group/blog has no avatar or gravatar */
-	$bp->grav_default->user = apply_filters( 'bp_user_gravatar_default', $bp->site_options['user-avatar-default'] );
+	$bp->grav_default->user = apply_filters( 'bp_user_gravatar_default', !empty($bp->site_options['user-avatar-default']) );
 	$bp->grav_default->group = apply_filters( 'bp_group_gravatar_default', 'identicon' );
 	$bp->grav_default->blog = apply_filters( 'bp_blog_gravatar_default', 'identicon' );
 
@@ -180,14 +192,27 @@
 function bp_core_define_slugs() {
 	global $bp;
 
-	if ( !defined( 'BP_MEMBERS_SLUG' ) )
-		define( 'BP_MEMBERS_SLUG', $bp->pages->members->slug );
+	if ( !defined( 'BP_MEMBERS_SLUG' ) ) {
+		if (!empty( $bp->pages->members->slug ) ) {
+			define( 'BP_MEMBERS_SLUG', $bp->pages->members->slug );
+		} else {
+			define( 'BP_MEMBERS_SLUG', '' );
+		}
+	}
 
 	if ( !defined( 'BP_REGISTER_SLUG' ) )
-		define( 'BP_REGISTER_SLUG', $bp->pages->register->slug );
+		if (!empty( $bp->pages->register->slug ) ) {
+			define( 'BP_REGISTER_SLUG', $bp->pages->register->slug );
+		} else {
+			define( 'BP_REGISTER_SLUG', '' );
+		}
 
 	if ( !defined( 'BP_ACTIVATION_SLUG' ) )
-		define( 'BP_ACTIVATION_SLUG', $bp->pages->activate->slug );
+		if (!empty( $bp->pages->activate->slug ) ) {
+			define( 'BP_ACTIVATION_SLUG', $bp->pages->activate->slug );
+		} else {
+			define( 'BP_ACTIVATION_SLUG', '');
+		}
 }
 add_action( 'bp_setup_globals', 'bp_core_define_slugs' );
 
@@ -960,7 +985,7 @@
 			if ( $bp->loggedin_user->id == $user_id )
 				$ud = &$bp->loggedin_user->userdata;
 
-			if ( $bp->displayed_user->id == $user_id )
+			if ( !empty($bp->displayed_user->id) && $bp->displayed_user->id == $user_id )
 				$ud = &$bp->displayed_user->userdata;
 
 			if ( empty( $ud ) ) {
