You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if ( ! function_exists('normalize_email'))
{
/**
* to normalize emails to a base format, especially for gmail
* @param $email
* @return string
*/
function normalize_email($email) {
// ensure email is lowercase because of pending in_array check, and more...
$email = strtolower($email);
$parts = explode('@', $email);
// normalize gmail addresses
if (in_array($parts[1], ['gmail.com', 'googlemail.com'])) {
// check if there is a "+" and return the string before then remove "."
$before_plus = strstr($parts[0], '+', TRUE);
$before_at = str_replace('.', '', $before_plus ? $before_plus : $parts[0]);
// ensure only @gmail.com addresses are used
$email = $before_at.'@gmail.com';
}
return $email;
}
}
We might want to skip the plus parts though. For example I use a lot of username+test email addresses. I don't think it'd be worth it to filter user capabilities to only allow admins to do this or something.
The text was updated successfully, but these errors were encountered:
Consider a function like this one:
We might want to skip the plus parts though. For example I use a lot of username+test email addresses. I don't think it'd be worth it to filter user capabilities to only allow admins to do this or something.
The text was updated successfully, but these errors were encountered: