diff --git a/includes/openid-connect-generic-client-wrapper.php b/includes/openid-connect-generic-client-wrapper.php index 32df4bc..0bf5278 100644 --- a/includes/openid-connect-generic-client-wrapper.php +++ b/includes/openid-connect-generic-client-wrapper.php @@ -544,15 +544,15 @@ class OpenID_Connect_Generic_Client_Wrapper { // copy the username for incrementing $username = $normalized_username; - if (!$this->settings->link_existing_users) { - // original user gets "name" - // second user gets "name2" - // etc - $count = 1; - while ( username_exists( $username ) ) { - $count ++; - $username = $normalized_username . $count; - } + if ( ! $this->settings->link_existing_users ) { + // original user gets "name" + // second user gets "name2" + // etc + $count = 1; + while ( username_exists( $username ) ) { + $count ++; + $username = $normalized_username . $count; + } } return $username; diff --git a/readme.txt b/readme.txt index 2782447..93da2f8 100644 --- a/readme.txt +++ b/readme.txt @@ -57,6 +57,7 @@ On the settings page for this plugin (Dashboard > Settings > OpenID Connect Gene * Fix: @cs1m0n - Only increment username during new user creation if the "Link existing user" setting is enabled. * Fix: @xRy-42 - Allow periods and spaces in usernames to match what WordPress core allows. * Feature: @benochen - New setting named "Create user if does not exist" determines whether new users are created during login attempts. +* Improvement: @flat235 - Username transliteration and normalization. = 3.5.1 =