From d0706ac9ca142a9073835cb6eb8668cbbb3da7a6 Mon Sep 17 00:00:00 2001 From: Jeremy Felt Date: Thu, 10 Sep 2015 03:52:21 +0000 Subject: [PATCH] Multisite: Remove `$domain` and `$path` globals in `ms_not_installed()` Further reduces the reliance on these unnecessary globals. Fixes #27264. git-svn-id: https://develop.svn.wordpress.org/trunk@33989 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/ms-load.php | 12 +++++++----- src/wp-includes/ms-settings.php | 8 ++++---- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/wp-includes/ms-load.php b/src/wp-includes/ms-load.php index e067193f46..b296b4ce44 100644 --- a/src/wp-includes/ms-load.php +++ b/src/wp-includes/ms-load.php @@ -394,13 +394,15 @@ function get_site_by_path( $domain, $path, $segments = null ) { * * @access private * @since 3.0.0 + * @since 4.3.0 The `$domain` and `$path` parameters were added. * - * @global wpdb $wpdb - * @global string $domain - * @global string $path + * @global wpdb $wpdb + * + * @param string $domain The requested domain for the error to reference. + * @param string $path The requested path for the error to reference. */ -function ms_not_installed() { - global $wpdb, $domain, $path; +function ms_not_installed( $domain, $path ) { + global $wpdb; if ( ! is_admin() ) { dead_db(); diff --git a/src/wp-includes/ms-settings.php b/src/wp-includes/ms-settings.php index 7b35e7616f..d7f42b367d 100644 --- a/src/wp-includes/ms-settings.php +++ b/src/wp-includes/ms-settings.php @@ -78,7 +78,7 @@ if ( !isset( $current_site ) || !isset( $current_blog ) ) { $current_site = wp_get_network( $one_network ); wp_cache_add( 'current_network', $current_site, 'site-options' ); } elseif ( 0 === $wpdb->num_rows ) { - ms_not_installed(); + ms_not_installed( $domain, $path ); } } if ( empty( $current_site ) ) { @@ -86,7 +86,7 @@ if ( !isset( $current_site ) || !isset( $current_blog ) ) { } if ( empty( $current_site ) ) { - ms_not_installed(); + ms_not_installed( $domain, $path ); } elseif ( $path === $current_site->path ) { $current_blog = get_site_by_path( $domain, $path ); } else { @@ -111,7 +111,7 @@ if ( !isset( $current_site ) || !isset( $current_blog ) ) { // No network has been found, bail. if ( empty( $current_site ) ) { - ms_not_installed(); + ms_not_installed( $domain, $path ); } // @todo Investigate when exactly this can occur. @@ -156,7 +156,7 @@ if ( !isset( $current_site ) || !isset( $current_blog ) ) { * it's no use redirecting back to ourselves -- it'll cause a loop. * As we couldn't find a site, we're simply not installed. */ - ms_not_installed(); + ms_not_installed( $domain, $path ); } header( 'Location: ' . $destination );