mirror of
https://github.com/nextcloud/server.git
synced 2026-06-13 10:40:40 -04:00
Merge pull request #35803 from nextcloud/backport/34629/stable25
[stable25] Fix case sensitivity of email when saving settings
This commit is contained in:
commit
a6c11af60d
2 changed files with 10 additions and 2 deletions
|
|
@ -484,7 +484,7 @@ class UsersController extends Controller {
|
|||
|
||||
$oldEmailAddress = $userAccount->getUser()->getSystemEMailAddress();
|
||||
$oldEmailAddress = strtolower((string)$oldEmailAddress);
|
||||
if ($oldEmailAddress !== $userAccount->getProperty(IAccountManager::PROPERTY_EMAIL)->getValue()) {
|
||||
if ($oldEmailAddress !== strtolower($userAccount->getProperty(IAccountManager::PROPERTY_EMAIL)->getValue())) {
|
||||
// this is the only permission a backend provides and is also used
|
||||
// for the permission of setting a email address
|
||||
if (!$userAccount->getUser()->canChangeDisplayName()) {
|
||||
|
|
|
|||
|
|
@ -624,7 +624,7 @@ class UsersControllerTest extends \Test\TestCase {
|
|||
$user->method('getSystemEMailAddress')->willReturn($oldEmailAddress);
|
||||
$user->method('canChangeDisplayName')->willReturn(true);
|
||||
|
||||
if ($data[IAccountManager::PROPERTY_EMAIL]['value'] === $oldEmailAddress ||
|
||||
if (strtolower($data[IAccountManager::PROPERTY_EMAIL]['value']) === strtolower($oldEmailAddress) ||
|
||||
($oldEmailAddress === null && $data[IAccountManager::PROPERTY_EMAIL]['value'] === '')) {
|
||||
$user->expects($this->never())->method('setSystemEMailAddress');
|
||||
} else {
|
||||
|
|
@ -720,6 +720,14 @@ class UsersControllerTest extends \Test\TestCase {
|
|||
'john@example.com',
|
||||
null
|
||||
],
|
||||
[
|
||||
[
|
||||
IAccountManager::PROPERTY_EMAIL => ['value' => 'john@example.com'],
|
||||
IAccountManager::PROPERTY_DISPLAYNAME => ['value' => 'john doe'],
|
||||
],
|
||||
'JOHN@example.com',
|
||||
null
|
||||
],
|
||||
|
||||
];
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue