WordPress.org

Make WordPress Core

Ticket #13760: use-wpmu_validate_user_signup.13760.diff

File use-wpmu_validate_user_signup.13760.diff, 739 bytes (added by filosofo, 8 years ago)
  • wp-includes/ms-functions.php

     
    731731        $meta = unserialize($signup->meta);
    732732        $user_login = $wpdb->escape($signup->user_login);
    733733        $user_email = $wpdb->escape($signup->user_email);
    734         wpmu_validate_user_signup($user_login, $user_email);
     734        $result = wpmu_validate_user_signup($user_login, $user_email);
     735        if ( empty( $result['errors']->errors ) ) {
     736                $user_login = $result['user_name'];
     737                $user_email = $result['user_email'];
     738        } else {
     739                return $result['errors'];
     740        }
     741
    735742        $password = wp_generate_password();
    736743
    737744        $user_id = username_exists($user_login);