From f8a05879e88e5164e9b67a81af4c878dd91997c5 Mon Sep 17 00:00:00 2001 From: Jeremy Felt Date: Sat, 10 Oct 2015 01:42:26 +0000 Subject: [PATCH] MS: Show an error if a new site slug conflicts with an existing username. Props utkarshpatel, dipesh.kakadiya. Fixes #33804. Built from https://develop.svn.wordpress.org/trunk@34996 git-svn-id: http://core.svn.wordpress.org/trunk@34961 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/network/site-new.php | 4 ++++ wp-includes/version.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/wp-admin/network/site-new.php b/wp-admin/network/site-new.php index 238fd4d553..dac11614a4 100644 --- a/wp-admin/network/site-new.php +++ b/wp-admin/network/site-new.php @@ -90,6 +90,10 @@ if ( isset($_REQUEST['action']) && 'add-site' == $_REQUEST['action'] ) { $password = 'N/A'; $user_id = email_exists($email); if ( !$user_id ) { // Create a new user with a random password + $user_id = username_exists( $domain ); + if ( $user_id ) { + wp_die( __( 'The domain or path entered conflicts with an existing username.' ) ); + } $password = wp_generate_password( 12, false ); $user_id = wpmu_create_user( $domain, $password, $email ); if ( false === $user_id ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index 22040a64f0..7295295c5f 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-alpha-34995'; +$wp_version = '4.4-alpha-34996'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.