diff --git a/src/Authentication/Passwords/NothingPersonalValidator.php b/src/Authentication/Passwords/NothingPersonalValidator.php index ef11ffbae..92151e8b0 100644 --- a/src/Authentication/Passwords/NothingPersonalValidator.php +++ b/src/Authentication/Passwords/NothingPersonalValidator.php @@ -72,15 +72,8 @@ protected function isNotPersonal(string $password, ?User $user): bool $needles = $this->strip_explode($userName); // extract local-part and domain parts from email as separate needles - if (str_contains($email, '@')) { - [ - $localPart, - $domain, - ] = explode('@', $email); - } else { - $localPart = $email; - $domain = null; - } + [$localPart, $domain] = explode('@', $email) + [1 => null]; + // might be john.doe@example.com and we want all the needles we can get $emailParts = $this->strip_explode($localPart); if (! empty($domain)) {