diff --git a/wp-admin/user-edit.php b/wp-admin/user-edit.php index 628aadb076..1166621f9f 100644 --- a/wp-admin/user-edit.php +++ b/wp-admin/user-edit.php @@ -64,7 +64,7 @@ $new_user_login = $_POST['new_user_login']; $new_firstname = $_POST['new_firstname']; $new_lastname = $_POST['new_lastname']; $new_nickname = $_POST['new_nickname']; -$new_nicename = sanitize_title($new_nickname); +$new_nicename = sanitize_title($new_nickname, $user_id); $new_icq = $_POST['new_icq']; $new_aim = $_POST['new_aim']; $new_msn = $_POST['new_msn']; diff --git a/wp-admin/users.php b/wp-admin/users.php index 5ff743fa58..0c143eee86 100644 --- a/wp-admin/users.php +++ b/wp-admin/users.php @@ -70,7 +70,9 @@ case 'adduser': return false; } - $user_nicename = sanitize_title($user_nickname); + $user_ID = $wpdb->get_var("SELECT ID FROM $wpdb->users ORDER BY ID DESC LIMIT 1") + 1; + + $user_nicename = sanitize_title($user_nickname, $user_ID); $user_uri = preg_match('/^(https?|ftps?|mailto|news|gopher):/is', $user_uri) ? $user_uri : 'http://' . $user_uri; $now = gmdate('Y-m-d H:i:s'); $new_users_can_blog = get_settings('new_users_can_blog');