Multisite: Remove `$domain` and `$path` globals in `ms_not_installed()`
Further reduces the reliance on these unnecessary globals. Fixes #27264. Built from https://develop.svn.wordpress.org/trunk@33989 git-svn-id: http://core.svn.wordpress.org/trunk@33958 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
d1f818a61d
commit
7278744dd0
|
@ -394,13 +394,15 @@ function get_site_by_path( $domain, $path, $segments = null ) {
|
||||||
*
|
*
|
||||||
* @access private
|
* @access private
|
||||||
* @since 3.0.0
|
* @since 3.0.0
|
||||||
|
* @since 4.3.0 The `$domain` and `$path` parameters were added.
|
||||||
*
|
*
|
||||||
* @global wpdb $wpdb
|
* @global wpdb $wpdb
|
||||||
* @global string $domain
|
*
|
||||||
* @global string $path
|
* @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() {
|
function ms_not_installed( $domain, $path ) {
|
||||||
global $wpdb, $domain, $path;
|
global $wpdb;
|
||||||
|
|
||||||
if ( ! is_admin() ) {
|
if ( ! is_admin() ) {
|
||||||
dead_db();
|
dead_db();
|
||||||
|
|
|
@ -78,7 +78,7 @@ if ( !isset( $current_site ) || !isset( $current_blog ) ) {
|
||||||
$current_site = wp_get_network( $one_network );
|
$current_site = wp_get_network( $one_network );
|
||||||
wp_cache_add( 'current_network', $current_site, 'site-options' );
|
wp_cache_add( 'current_network', $current_site, 'site-options' );
|
||||||
} elseif ( 0 === $wpdb->num_rows ) {
|
} elseif ( 0 === $wpdb->num_rows ) {
|
||||||
ms_not_installed();
|
ms_not_installed( $domain, $path );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( empty( $current_site ) ) {
|
if ( empty( $current_site ) ) {
|
||||||
|
@ -86,7 +86,7 @@ if ( !isset( $current_site ) || !isset( $current_blog ) ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( empty( $current_site ) ) {
|
if ( empty( $current_site ) ) {
|
||||||
ms_not_installed();
|
ms_not_installed( $domain, $path );
|
||||||
} elseif ( $path === $current_site->path ) {
|
} elseif ( $path === $current_site->path ) {
|
||||||
$current_blog = get_site_by_path( $domain, $path );
|
$current_blog = get_site_by_path( $domain, $path );
|
||||||
} else {
|
} else {
|
||||||
|
@ -111,7 +111,7 @@ if ( !isset( $current_site ) || !isset( $current_blog ) ) {
|
||||||
|
|
||||||
// No network has been found, bail.
|
// No network has been found, bail.
|
||||||
if ( empty( $current_site ) ) {
|
if ( empty( $current_site ) ) {
|
||||||
ms_not_installed();
|
ms_not_installed( $domain, $path );
|
||||||
}
|
}
|
||||||
|
|
||||||
// @todo Investigate when exactly this can occur.
|
// @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.
|
* 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.
|
* As we couldn't find a site, we're simply not installed.
|
||||||
*/
|
*/
|
||||||
ms_not_installed();
|
ms_not_installed( $domain, $path );
|
||||||
}
|
}
|
||||||
|
|
||||||
header( 'Location: ' . $destination );
|
header( 'Location: ' . $destination );
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.4-alpha-33988';
|
$wp_version = '4.4-alpha-33989';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue