From 8c0ad8bb3654b4c92cb0e66f7746ffbe1da0cb69 Mon Sep 17 00:00:00 2001 From: ryan Date: Tue, 7 Mar 2006 07:06:43 +0000 Subject: [PATCH] Sanitize user_login in register form git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@3630 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-register.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/wp-register.php b/wp-register.php index 1177c12867..49798c3314 100644 --- a/wp-register.php +++ b/wp-register.php @@ -25,10 +25,13 @@ case 'register': $errors['user_email'] = __('ERROR: Please type your e-mail address.'); } else if (!is_email($user_email)) { $errors['user_email'] = __('ERROR: The email address isn’t correct.'); + $user_email = ''; } - if ( ! validate_username($user_login) ) + if ( ! validate_username($user_login) ) { $errors['user_login'] = __('ERROR: This username is invalid. Please enter a valid username.'); + $user_login = ''; + } if ( username_exists( $user_login ) ) $errors['user_login'] = __('ERROR: This username is already registered, please choose another one.'); @@ -67,9 +70,9 @@ case 'register':

-

$user_login") ?>
+

" . wp_specialchars($user_login) . "") ?>
' . __('emailed to you') . '') ?>
- $user_email") ?>

+ " . wp_specialchars($user_email) . "") ?>

»

@@ -110,8 +113,8 @@ default:

-

-


+

+