mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Merge branch '4.9' into 4
This commit is contained in:
commit
ba3872d110
@ -103,17 +103,18 @@ class TestMailer implements Mailer
|
|||||||
foreach ($this->emailsSent as $email) {
|
foreach ($this->emailsSent as $email) {
|
||||||
$matched = true;
|
$matched = true;
|
||||||
|
|
||||||
foreach (['To', 'From', 'Subject', 'Content'] as $field) {
|
// Loop all our Email fields
|
||||||
|
foreach ($compare as $field => $value) {
|
||||||
$emailValue = $email[$field];
|
$emailValue = $email[$field];
|
||||||
if ($value = $compare[$field]) {
|
if ($value) {
|
||||||
if ($field == 'To') {
|
if (in_array($field, ['To', 'From'])) {
|
||||||
$emailValue = $this->normaliseSpaces($emailValue);
|
$emailValue = $this->normaliseSpaces($emailValue);
|
||||||
$value = $this->normaliseSpaces($value);
|
$value = $this->normaliseSpaces($value);
|
||||||
}
|
}
|
||||||
if ($value[0] == '/') {
|
if ($value[0] === '/') {
|
||||||
$matched = preg_match($value, $emailValue);
|
$matched = preg_match($value, $emailValue);
|
||||||
} else {
|
} else {
|
||||||
$matched = ($value == $emailValue);
|
$matched = ($value === $emailValue);
|
||||||
}
|
}
|
||||||
if (!$matched) {
|
if (!$matched) {
|
||||||
break;
|
break;
|
||||||
|
@ -910,6 +910,7 @@ class Member extends DataObject
|
|||||||
if ((Director::isLive() || Injector::inst()->get(Mailer::class) instanceof TestMailer)
|
if ((Director::isLive() || Injector::inst()->get(Mailer::class) instanceof TestMailer)
|
||||||
&& $this->isChanged('Password')
|
&& $this->isChanged('Password')
|
||||||
&& $this->record['Password']
|
&& $this->record['Password']
|
||||||
|
&& $this->Email
|
||||||
&& static::config()->get('notify_password_change')
|
&& static::config()->get('notify_password_change')
|
||||||
&& $this->isInDB()
|
&& $this->isInDB()
|
||||||
) {
|
) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user