From a9da055b5b17a1f935c56051d968203f0b458ae8 Mon Sep 17 00:00:00 2001 From: Jeremy Felt Date: Sun, 6 Dec 2015 18:24:26 +0000 Subject: [PATCH] MS: Populate `public` on empty `$current_blog` during subdomain activation. Activation of a subdomain site is done through that new site's address. This address does not exist in the `wp_blogs` table until activation is complete. In this case we need to make sure `public` is populated to avoid a PHP notice. Props uglyrobot. Fixes #24760. Built from https://develop.svn.wordpress.org/trunk@35782 git-svn-id: http://core.svn.wordpress.org/trunk@35746 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/ms-settings.php | 3 ++- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/wp-includes/ms-settings.php b/wp-includes/ms-settings.php index a490c22248..aad6269f3f 100644 --- a/wp-includes/ms-settings.php +++ b/wp-includes/ms-settings.php @@ -135,10 +135,11 @@ if ( !isset( $current_site ) || !isset( $current_blog ) ) { ms_not_installed( $domain, $path ); } - // @todo Investigate when exactly this can occur. + // During activation of a new subdomain, the requested site does not yet exist. if ( empty( $current_blog ) && wp_installing() ) { $current_blog = new stdClass; $current_blog->blog_id = $blog_id = 1; + $current_blog->public = 1; } // No site has been found, bail. diff --git a/wp-includes/version.php b/wp-includes/version.php index 4b6108c6df..a06baa5a29 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.5-alpha-35781'; +$wp_version = '4.5-alpha-35782'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.