diff --git a/src/wp-includes/ms-settings.php b/src/wp-includes/ms-settings.php index 4f9d9e35792b3..b02dc9d161379 100644 --- a/src/wp-includes/ms-settings.php +++ b/src/wp-includes/ms-settings.php @@ -99,6 +99,8 @@ wp_load_core_site_options( $site_id ); } +assert( isset( $wpdb ) ); +assert( isset( $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(); diff --git a/src/wp-settings.php b/src/wp-settings.php index 023cdccd5ecc9..03c95fbe0a870 100644 --- a/src/wp-settings.php +++ b/src/wp-settings.php @@ -100,7 +100,7 @@ include WP_CONTENT_DIR . '/advanced-cache.php'; // Re-initialize any hooks added manually by advanced-cache.php. - if ( $wp_filter ) { + if ( ! empty( $wp_filter ) ) { $wp_filter = WP_Hook::build_preinitialized_hooks( $wp_filter ); } } @@ -141,6 +141,7 @@ * @global string $table_prefix The database table prefix. */ if ( ! isset( $GLOBALS['table_prefix'] ) ) { + assert( isset( $table_prefix ) ); $GLOBALS['table_prefix'] = $table_prefix; }