Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/Authentication/Passwords/NothingPersonalValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,16 @@ protected function isNotPersonal(string $password, ?User $user): bool
$needles = $this->strip_explode($userName);

// extract local-part and domain parts from email as separate needles
[
$localPart,
$domain,
] = explode('@', $email);
if (str_contains($email, '@')) {
[
$localPart,
$domain,
] = explode('@', $email);
} else {
$localPart = $email;
$domain = null;
}

// might be john.doe@example.com and we want all the needles we can get
$emailParts = $this->strip_explode($localPart);
if (! empty($domain)) {
Expand Down