Merge pull request #23720 from nextcloud/lowercase-email

save email as lower case
This commit is contained in:
Roeland Jago Douma 2020-10-27 20:14:43 +01:00 committed by GitHub
commit 28d82394f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

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