From 5ea8b0e8e662949bb6d1531e5c07ba91253a8f81 Mon Sep 17 00:00:00 2001 From: Berend de Jong Date: Sun, 10 Aug 2014 22:29:27 +0700 Subject: [PATCH] Prevent spaces in usernames (were created when last names had multiple words) --- social-connect.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/social-connect.php b/social-connect.php index 9c266ff..ecdeb9e 100644 --- a/social-connect.php +++ b/social-connect.php @@ -117,7 +117,7 @@ function sc_social_connect_process_login( $is_ajax = false ) { $sc_last_name = $fb_json->{ 'last_name' }; $sc_profile_url = $fb_json->{ 'link' }; $sc_name = $sc_first_name . ' ' . $sc_last_name; - $user_login = strtolower( $sc_first_name.$sc_last_name ); + $user_login = strtolower( str_replace( ' ', '', $sc_first_name . $sc_last_name ) ); break; case 'twitter': $sc_provider_identity = $_REQUEST[ 'social_connect_twitter_identity' ]; @@ -142,7 +142,7 @@ function sc_social_connect_process_login( $is_ajax = false ) { $sc_last_name = $_REQUEST[ 'social_connect_last_name' ]; $sc_profile_url = ''; $sc_name = $sc_first_name . ' ' . $sc_last_name; - $user_login = strtolower( $sc_first_name.$sc_last_name ); + $user_login = strtolower( str_replace( ' ', '', $sc_first_name . $sc_last_name ) ); break; case 'yahoo': $sc_provider_identity = $_REQUEST[ 'social_connect_openid_identity' ]; @@ -167,7 +167,7 @@ function sc_social_connect_process_login( $is_ajax = false ) { $sc_first_name = $names[0]; $sc_last_name = $names[1]; } - $user_login = strtolower( $sc_first_name.$sc_last_name ); + $user_login = strtolower( str_replace( ' ', '', $sc_first_name . $sc_last_name ) ); break; case 'wordpress': $sc_provider_identity = $_REQUEST[ 'social_connect_openid_identity' ]; @@ -185,7 +185,7 @@ function sc_social_connect_process_login( $is_ajax = false ) { $sc_first_name = $names[0]; $sc_last_name = $names[1]; } - $user_login = strtolower( $sc_first_name.$sc_last_name ); + $user_login = strtolower( str_replace( ' ', '', $sc_first_name . $sc_last_name ) ); break; default: break;