diff --git a/wp-admin/includes/schema.php b/wp-admin/includes/schema.php index d5ba04c95b..c9cee07527 100644 --- a/wp-admin/includes/schema.php +++ b/wp-admin/includes/schema.php @@ -905,8 +905,16 @@ function populate_network( $network_id = 1, $domain = '', $email = '', $site_nam $errors->add( 'empty_sitename', __( 'You must provide a name for your network of sites.' ) ); // Check for network collision. - if ( $network_id == $wpdb->get_var( $wpdb->prepare( "SELECT id FROM $wpdb->site WHERE id = %d", $network_id ) ) ) - $errors->add( 'siteid_exists', __( 'The network already exists.' ) ); + $network_exists = false; + if ( is_multisite() ) { + if ( get_network( (int) $network_id ) ) { + $errors->add( 'siteid_exists', __( 'The network already exists.' ) ); + } + } else { + if ( $network_id == $wpdb->get_var( $wpdb->prepare( "SELECT id FROM $wpdb->site WHERE id = %d", $network_id ) ) ) { + $errors->add( 'siteid_exists', __( 'The network already exists.' ) ); + } + } if ( ! is_email( $email ) ) $errors->add( 'invalid_email', __( 'You must provide a valid email address.' ) ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 1c3a37d22d..a03881e4a3 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.9-alpha-41347'; +$wp_version = '4.9-alpha-41348'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.