diff --git a/wp-includes/ms-functions.php b/wp-includes/ms-functions.php index 825495c538..4ba038cd00 100644 --- a/wp-includes/ms-functions.php +++ b/wp-includes/ms-functions.php @@ -682,7 +682,7 @@ function wpmu_validate_blog_signup( $blogname, $blog_title, $user = '' ) { $errors->add( 'blogname', sprintf( _n( 'Site name must be at least %s character.', 'Site name must be at least %s characters.', $minimum_site_name_length ), number_format_i18n( $minimum_site_name_length ) ) ); } - // Do not allow users to create a blog that conflicts with a page on the main blog. + // Do not allow users to create a site that conflicts with a page on the main blog. if ( ! is_subdomain_install() && $wpdb->get_var( $wpdb->prepare( 'SELECT post_name FROM ' . $wpdb->get_blog_prefix( $current_network->site_id ) . "posts WHERE post_type = 'page' AND post_name = %s", $blogname ) ) ) { $errors->add( 'blogname', __( 'Sorry, you may not use that site name.' ) ); } @@ -722,6 +722,10 @@ function wpmu_validate_blog_signup( $blogname, $blog_title, $user = '' ) { $errors->add( 'blogname', __( 'Sorry, that site already exists!' ) ); } + /* + * Do not allow users to create a site that matches an existing user's login name, + * unless it's the user's own username. + */ if ( username_exists( $blogname ) ) { if ( ! is_object( $user ) || ( is_object( $user ) && ( $user->user_login != $blogname ) ) ) { $errors->add( 'blogname', __( 'Sorry, that site is reserved!' ) ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 032fd4f613..a9b3551496 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.0-alpha-52654'; +$wp_version = '6.0-alpha-52655'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.