Commit d5486122 authored by jcnventura's avatar jcnventura Committed by Joao Ventura

Issue #3117414 by pjotr.savitski, jcnventura: hook_user_format_name_alter has incorrect code

parent 3de09230
......@@ -94,7 +94,7 @@ function openid_connect_user_format_name_alter(&$name, $account) {
// Ensure that usernames are not displayed if they are email addresses, or if
// they are generated names starting with 'oidc_'.
$oidc_name = \Drupal::service('user.data')->get('openid_connect', $account->id(), 'oidc_name');
if (!empty($oidc_name) && (strpos($name, 'oidc_') === 0 || strpos($name, '@'))) {
if (!empty($oidc_name) && (strpos($name, 'oidc_') !== 0) && (strpos($name, '@') !== FALSE)) {
$name = $oidc_name;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment