Merge pull request #23734 from nextcloud/backport/23720/stable19

[stable19] save email as lower case
This commit is contained in:
Morris Jobke 2020-10-28 08:49:10 +01:00 committed by GitHub
commit 4d20a63d4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -343,6 +343,7 @@ class UsersController extends Controller {
$twitter,
$twitterScope
) {
$email = strtolower($email);
if (!empty($email) && !$this->mailer->validateMailAddress($email)) {
return new DataResponse(
[
@ -422,7 +423,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']
) {