diff options
| author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2008-07-28 16:28:29 +0000 |
|---|---|---|
| committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2008-07-28 16:28:29 +0000 |
| commit | 08de3b1ebbc678f43751ae346b9558cfa4a7bd77 (patch) | |
| tree | 00e71024b1bc5e451ac529adffa43cb9c4af4d7d /wp-includes | |
| parent | 724d45673fd1912a4dc82137c8bdf8b255810d51 (diff) | |
| download | wordpress-mu-08de3b1ebbc678f43751ae346b9558cfa4a7bd77.tar.gz wordpress-mu-08de3b1ebbc678f43751ae346b9558cfa4a7bd77.tar.xz wordpress-mu-08de3b1ebbc678f43751ae346b9558cfa4a7bd77.zip | |
Remove whitespace from usernames and domain names
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1405 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-includes')
| -rw-r--r-- | wp-includes/wpmu-functions.php | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/wp-includes/wpmu-functions.php b/wp-includes/wpmu-functions.php index 3deae7a..567002b 100644 --- a/wp-includes/wpmu-functions.php +++ b/wp-includes/wpmu-functions.php @@ -830,7 +830,7 @@ function wpmu_validate_user_signup($user_name, $user_email) { $errors = new WP_Error(); - $user_name = sanitize_user($user_name); + $user_name = preg_replace( "/\s+/", '', sanitize_user( $user_name, true ) ); $user_email = sanitize_email( $user_email ); if ( empty( $user_name ) ) @@ -927,7 +927,7 @@ function wpmu_validate_user_signup($user_name, $user_email) { function wpmu_validate_blog_signup($blogname, $blog_title, $user = '') { global $wpdb, $domain, $base; - $blogname = sanitize_user( $blogname, true ); + $blogname = preg_replace( "/\s+/", '', sanitize_user( $blogname, true ) ); $blog_title = strip_tags( $blog_title ); $blog_title = substr( $blog_title, 0, 50 ); @@ -1026,7 +1026,7 @@ function wpmu_signup_blog($domain, $path, $title, $user, $user_email, $meta = '' function wpmu_signup_user($user, $user_email, $meta = '') { global $wpdb; - $user = sanitize_user( $user ); + $user = preg_replace( "/\s+/", '', sanitize_user( $user, true ) ); $user_email = sanitize_email( $user_email ); $key = substr( md5( time() . rand() . $user_email ), 0, 16 ); @@ -1151,7 +1151,7 @@ function generate_random_password( $len = 8 ) { } function wpmu_create_user( $user_name, $password, $email) { - $user_name = sanitize_user( $user_name, true ); + $user_name = preg_replace( "/\s+/", '', sanitize_user( $user_name, true ) ); if ( username_exists($user_name) ) return false; @@ -1171,7 +1171,7 @@ function wpmu_create_user( $user_name, $password, $email) { } function wpmu_create_blog($domain, $path, $title, $user_id, $meta = '', $site_id = 1) { - $domain = sanitize_user( $domain, true ); + $domain = preg_replace( "/\s+/", '', sanitize_user( $domain, true ) ); if( constant( 'VHOST' ) == 'yes' ) $domain = str_replace( '@', '', $domain ); $title = strip_tags( $title ); |
