summaryrefslogtreecommitdiffstats
path: root/wp-includes
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2007-10-03 09:52:13 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2007-10-03 09:52:13 +0000
commit794932b9d2bdb8225d1ac0a373951846a46ac425 (patch)
treeca8f33ec229da9e51f724063cbc93d5e79908736 /wp-includes
parentc94e1f1a316d373a623246b045cb0feb0753f436 (diff)
downloadwordpress-mu-794932b9d2bdb8225d1ac0a373951846a46ac425.tar.gz
wordpress-mu-794932b9d2bdb8225d1ac0a373951846a46ac425.tar.xz
wordpress-mu-794932b9d2bdb8225d1ac0a373951846a46ac425.zip
Only allow lowercase letters in username and blogname on registration
Don't lowercase username on login. Fixes #425 git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1057 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-includes')
-rw-r--r--wp-includes/wpmu-functions.php16
1 files changed, 8 insertions, 8 deletions
diff --git a/wp-includes/wpmu-functions.php b/wp-includes/wpmu-functions.php
index 14bd405..ad22c68 100644
--- a/wp-includes/wpmu-functions.php
+++ b/wp-includes/wpmu-functions.php
@@ -913,10 +913,10 @@ function wpmu_validate_user_signup($user_name, $user_email) {
if ( empty( $user_name ) )
$errors->add('user_name', __("Please enter a username"));
- preg_match( "/[a-zA-Z0-9]+/", $user_name, $maybe );
+ preg_match( "/[a-z0-9]+/", $user_name, $maybe );
if( $user_name != $maybe[0] ) {
- $errors->add('user_name', __("Only letters and numbers allowed"));
+ $errors->add('user_name', __("Only lowercase letters and numbers allowed"));
}
$illegal_names = get_site_option( "illegal_names" );
@@ -1015,9 +1015,9 @@ function wpmu_validate_blog_signup($blog_id, $blog_title, $user = '') {
if ( empty( $blog_id ) )
$errors->add('blog_id', __("Please enter a blog name"));
- preg_match( "/[a-zA-Z0-9]+/", $blog_id, $maybe );
+ preg_match( "/[a-z0-9]+/", $blog_id, $maybe );
if( $blog_id != $maybe[0] ) {
- $errors->add('blog_id', __("Only letters and numbers allowed"));
+ $errors->add('blog_id', __("Only lowercase letters and numbers allowed"));
}
if( in_array( $blog_id, $illegal_names ) == true ) {
$errors->add('blog_id', __("That name is not allowed"));
@@ -1864,13 +1864,13 @@ add_filter('the_title', 'wp_filter_kses');
function wp_login($username, $password, $already_md5 = false) {
global $wpdb, $error, $current_user;
- $username = strtolower($username);
+ $username = sanitize_user($username);
- if ( !$username )
+ if ( '' == $username )
return false;
- if ( !$password ) {
- $error = __('<strong>Error</strong>: The password field is empty.');
+ if ( '' == $password ) {
+ $error = __('<strong>ERROR</strong>: The password field is empty.');
return false;
}