Skip to content

Commit 21e9ec1

Browse files
authored
Merge pull request #23733 from nextcloud/backport/23720/stable20
[stable20] save email as lower case
2 parents da92c70 + d4303b6 commit 21e9ec1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

apps/settings/lib/Controller/UsersController.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,7 @@ public function setUserSettings($avatarScope,
360360
$twitter,
361361
$twitterScope
362362
) {
363+
$email = strtolower($email);
363364
if (!empty($email) && !$this->mailer->validateMailAddress($email)) {
364365
return new DataResponse(
365366
[
@@ -438,7 +439,7 @@ protected function saveUserSettings(IUser $user, array $data) {
438439
}
439440
}
440441
$oldEmailAddress = $user->getEMailAddress();
441-
$oldEmailAddress = is_null($oldEmailAddress) ? '' : $oldEmailAddress;
442+
$oldEmailAddress = is_null($oldEmailAddress) ? '' : strtolower($oldEmailAddress);
442443
if (isset($data[AccountManager::PROPERTY_EMAIL]['value'])
443444
&& $oldEmailAddress !== $data[AccountManager::PROPERTY_EMAIL]['value']
444445
) {

0 commit comments

Comments
 (0)