save email as lower case

email addresses are case insensitive

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2020-10-27 14:56:52 +01:00 committed by backportbot[bot]
parent 86c66c29a9
commit d4303b6e8a
1 changed files with 2 additions and 1 deletions

View File

@ -360,6 +360,7 @@ class UsersController extends Controller {
$twitter,
$twitterScope
) {
$email = strtolower($email);
if (!empty($email) && !$this->mailer->validateMailAddress($email)) {
return new DataResponse(
[
@ -438,7 +439,7 @@ class UsersController extends Controller {
}
}
$oldEmailAddress = $user->getEMailAddress();
$oldEmailAddress = is_null($oldEmailAddress) ? '' : $oldEmailAddress;
$oldEmailAddress = is_null($oldEmailAddress) ? '' : strtolower($oldEmailAddress);
if (isset($data[AccountManager::PROPERTY_EMAIL]['value'])
&& $oldEmailAddress !== $data[AccountManager::PROPERTY_EMAIL]['value']
) {