Merge branch '4.9' into 4

This commit is contained in:
Maxime Rainville 2021-09-13 12:14:05 +12:00
commit ba3872d110
2 changed files with 7 additions and 5 deletions

View File

@ -103,17 +103,18 @@ class TestMailer implements Mailer
foreach ($this->emailsSent as $email) {
$matched = true;
foreach (['To', 'From', 'Subject', 'Content'] as $field) {
// Loop all our Email fields
foreach ($compare as $field => $value) {
$emailValue = $email[$field];
if ($value = $compare[$field]) {
if ($field == 'To') {
if ($value) {
if (in_array($field, ['To', 'From'])) {
$emailValue = $this->normaliseSpaces($emailValue);
$value = $this->normaliseSpaces($value);
}
if ($value[0] == '/') {
if ($value[0] === '/') {
$matched = preg_match($value, $emailValue);
} else {
$matched = ($value == $emailValue);
$matched = ($value === $emailValue);
}
if (!$matched) {
break;

View File

@ -910,6 +910,7 @@ class Member extends DataObject
if ((Director::isLive() || Injector::inst()->get(Mailer::class) instanceof TestMailer)
&& $this->isChanged('Password')
&& $this->record['Password']
&& $this->Email
&& static::config()->get('notify_password_change')
&& $this->isInDB()
) {