Skip to content

Commit

Permalink
Merge pull request rodrigoprimo#64 from Frique/prevent-spaces-usernames
Browse files Browse the repository at this point in the history
Prevent spaces in usernames (were created when last names had multiple w...
  • Loading branch information
rodrigoprimo committed Aug 11, 2014
2 parents 310f30a + 5ea8b0e commit dc405d7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions social-connect.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' ];
Expand All @@ -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' ];
Expand All @@ -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' ];
Expand All @@ -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;
Expand Down

0 comments on commit dc405d7

Please sign in to comment.