WordPress.org

Make WordPress Core

Ticket #33804: 33804_3.diff

File 33804_3.diff, 630 bytes (added by utkarshpatel, 6 years ago)
  • wp-admin/network/site-new.php

    diff --git wp-admin/network/site-new.php wp-admin/network/site-new.php
    index 5876037..ccdf213 100644
    if ( isset($_REQUEST['action']) && 'add-site' == $_REQUEST['action'] ) { 
    8989        $password = 'N/A';
    9090        $user_id = email_exists($email);
    9191        if ( !$user_id ) { // Create a new user with a random password
     92                $user_id = username_exists($domain);
     93                if ( $user_id )
     94                        wp_die( __( 'Username already existed.' ) );
    9295                $password = wp_generate_password( 12, false );
    9396                $user_id = wpmu_create_user( $domain, $password, $email );
    9497                if ( false === $user_id )