diff options
author | Robin Appelman <robin@icewind.nl> | 2022-09-14 15:04:13 +0300 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2022-09-14 15:04:13 +0300 |
commit | 1fbb951691468c33dc1171731bcd9826b0064609 (patch) | |
tree | d8452848dc7270a16384bbf843b4febc5344f3f4 /lib | |
parent | b739dd580743aa3c339eba28c45f14d930956135 (diff) |
dont try email login if the provider username is not a valid emaillogin-email-filter
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/User/Session.php | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/private/User/Session.php b/lib/private/User/Session.php index 65a213d4bf8..5117812db31 100644 --- a/lib/private/User/Session.php +++ b/lib/private/User/Session.php @@ -450,6 +450,9 @@ class Session implements IUserSession, Emitter { if (!$this->login($user, $password)) { // Failed, maybe the user used their email address + if (!filter_var($user, FILTER_VALIDATE_EMAIL)) { + return false; + } $users = $this->manager->getByEmail($user); if (!(\count($users) === 1 && $this->login($users[0]->getUID(), $password))) { $this->logger->warning('Login failed: \'' . $user . '\' (Remote IP: \'' . \OC::$server->getRequest()->getRemoteAddress() . '\')', ['app' => 'core']); |