From 904c577e989305466ca5b04accc6f7dbbe3fa338 Mon Sep 17 00:00:00 2001 From: rboren Date: Tue, 1 Jun 2004 19:52:48 +0000 Subject: [PATCH] user_nicename fixes from JackSim. http://wordpress.org/support/4/6708 git-svn-id: http://svn.automattic.com/wordpress/trunk@1380 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/profile.php | 3 ++- wp-register.php | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/wp-admin/profile.php b/wp-admin/profile.php index bb42058c97..f273256b46 100644 --- a/wp-admin/profile.php +++ b/wp-admin/profile.php @@ -86,6 +86,7 @@ case 'update': $newuser_firstname=addslashes(stripslashes($_POST['newuser_firstname'])); $newuser_lastname=addslashes(stripslashes($_POST['newuser_lastname'])); $newuser_nickname=addslashes(stripslashes($_POST['newuser_nickname'])); + $newuser_nicename=sanitize_title($newuser_nickname); $newuser_icq=addslashes(stripslashes($_POST['newuser_icq'])); $newuser_aim=addslashes(stripslashes($_POST['newuser_aim'])); $newuser_msn=addslashes(stripslashes($_POST['newuser_msn'])); @@ -95,7 +96,7 @@ case 'update': $newuser_idmode=addslashes(stripslashes($_POST['newuser_idmode'])); $user_description = addslashes(stripslashes($_POST['user_description'])); - $query = "UPDATE $wpdb->users SET user_firstname='$newuser_firstname', $updatepassword user_lastname='$newuser_lastname', user_nickname='$newuser_nickname', user_icq='$newuser_icq', user_email='$newuser_email', user_url='$newuser_url', user_aim='$newuser_aim', user_msn='$newuser_msn', user_yim='$newuser_yim', user_idmode='$newuser_idmode', user_description = '$user_description' WHERE ID = $user_ID"; + $query = "UPDATE $wpdb->users SET user_firstname='$newuser_firstname', $updatepassword user_lastname='$newuser_lastname', user_nickname='$newuser_nickname', user_icq='$newuser_icq', user_email='$newuser_email', user_url='$newuser_url', user_aim='$newuser_aim', user_msn='$newuser_msn', user_yim='$newuser_yim', user_idmode='$newuser_idmode', user_description = '$user_description', user_nicename = '$newuser_nicename' WHERE ID = $user_ID"; $result = $wpdb->query($query); if (!$result) { die (__("ERROR: couldn't update your profile...")); diff --git a/wp-register.php b/wp-register.php index 109c0d9e28..2522041ce9 100644 --- a/wp-register.php +++ b/wp-register.php @@ -83,13 +83,14 @@ case 'register': $user_login = $wpdb->escape($user_login); $pass1 = $wpdb->escape($pass1); $user_nickname = $wpdb->escape($user_nickname); + $user_nicename = sanitize_title($user_nickname); $now = gmdate('Y-m-d H:i:s'); $new_users_can_blog = get_settings('new_users_can_blog'); $result = $wpdb->query("INSERT INTO $wpdb->users - (user_login, user_pass, user_nickname, user_email, user_ip, user_browser, dateYMDhour, user_level, user_idmode) + (user_login, user_pass, user_nickname, user_email, user_ip, user_browser, dateYMDhour, user_level, user_idmode, user_nicename) VALUES - ('$user_login', MD5('$pass1'), '$user_nickname', '$user_email', '$user_ip', '$user_browser', '$now', '$new_users_can_blog', 'nickname')"); + ('$user_login', MD5('$pass1'), '$user_nickname', '$user_email', '$user_ip', '$user_browser', '$now', '$new_users_can_blog', 'nickname', '$user_nicename')"); if ($result == false) { die (sprintf(__('ERROR: Couldn’t register you... please contact the webmaster !'), get_settings('admin_email')));