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
This commit is contained in:
parent
1b1e18027d
commit
f8a05879e8
|
@ -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 ) {
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue