user_nicename fixes from JackSim. http://wordpress.org/support/4/6708

git-svn-id: https://develop.svn.wordpress.org/trunk@1380 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2004-06-01 19:52:48 +00:00
parent b272e415af
commit fa50e0743c
2 changed files with 5 additions and 3 deletions

View File

@ -86,6 +86,7 @@ case 'update':
$newuser_firstname=addslashes(stripslashes($_POST['newuser_firstname'])); $newuser_firstname=addslashes(stripslashes($_POST['newuser_firstname']));
$newuser_lastname=addslashes(stripslashes($_POST['newuser_lastname'])); $newuser_lastname=addslashes(stripslashes($_POST['newuser_lastname']));
$newuser_nickname=addslashes(stripslashes($_POST['newuser_nickname'])); $newuser_nickname=addslashes(stripslashes($_POST['newuser_nickname']));
$newuser_nicename=sanitize_title($newuser_nickname);
$newuser_icq=addslashes(stripslashes($_POST['newuser_icq'])); $newuser_icq=addslashes(stripslashes($_POST['newuser_icq']));
$newuser_aim=addslashes(stripslashes($_POST['newuser_aim'])); $newuser_aim=addslashes(stripslashes($_POST['newuser_aim']));
$newuser_msn=addslashes(stripslashes($_POST['newuser_msn'])); $newuser_msn=addslashes(stripslashes($_POST['newuser_msn']));
@ -95,7 +96,7 @@ case 'update':
$newuser_idmode=addslashes(stripslashes($_POST['newuser_idmode'])); $newuser_idmode=addslashes(stripslashes($_POST['newuser_idmode']));
$user_description = addslashes(stripslashes($_POST['user_description'])); $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); $result = $wpdb->query($query);
if (!$result) { if (!$result) {
die (__("<strong>ERROR</strong>: couldn't update your profile...")); die (__("<strong>ERROR</strong>: couldn't update your profile..."));

View File

@ -83,13 +83,14 @@ case 'register':
$user_login = $wpdb->escape($user_login); $user_login = $wpdb->escape($user_login);
$pass1 = $wpdb->escape($pass1); $pass1 = $wpdb->escape($pass1);
$user_nickname = $wpdb->escape($user_nickname); $user_nickname = $wpdb->escape($user_nickname);
$user_nicename = sanitize_title($user_nickname);
$now = gmdate('Y-m-d H:i:s'); $now = gmdate('Y-m-d H:i:s');
$new_users_can_blog = get_settings('new_users_can_blog'); $new_users_can_blog = get_settings('new_users_can_blog');
$result = $wpdb->query("INSERT INTO $wpdb->users $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 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) { if ($result == false) {
die (sprintf(__('<strong>ERROR</strong>: Couldn&#8217;t register you... please contact the <a href="mailto:%s">webmaster</a> !'), get_settings('admin_email'))); die (sprintf(__('<strong>ERROR</strong>: Couldn&#8217;t register you... please contact the <a href="mailto:%s">webmaster</a> !'), get_settings('admin_email')));