mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX Fixed potential PHP notices if headers array not set for Bcc and Cc
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@73651 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
0085a1ad9d
commit
bd9778067c
@ -399,18 +399,24 @@ class Email extends ViewableData {
|
||||
if($this->bcc) $subject .= ", bcc to $this->bcc";
|
||||
$subject .= ']';
|
||||
} else {
|
||||
if($this->cc) $headers["Cc"] = $this->cc;
|
||||
if($this->bcc) $headers["Bcc"] = $this->bcc;
|
||||
if($this->cc) $headers['Cc'] = $this->cc;
|
||||
if($this->bcc) $headers['Bcc'] = $this->bcc;
|
||||
}
|
||||
|
||||
if(self::$cc_all_emails_to) {
|
||||
if(trim($headers['Cc'])) $headers['Cc'] .= ', ';
|
||||
$headers['Cc'] .= self::$cc_all_emails_to;
|
||||
if(!empty($headers['Cc']) && trim($headers['Cc'])) {
|
||||
$headers['Cc'] .= ', ' . self::$cc_all_emails_to;
|
||||
} else {
|
||||
$headers['Cc'] = self::$cc_all_emails_to;
|
||||
}
|
||||
}
|
||||
|
||||
if(self::$bcc_all_emails_to) {
|
||||
if(trim($headers['Bcc'])) $headers['Bcc'] .= ', ';
|
||||
$headers['Bcc'] .= self::$bcc_all_emails_to;
|
||||
if(!empty($headers['Bcc']) && trim($headers['Bcc'])) {
|
||||
$headers['Bcc'] .= ', ' . self::$bcc_all_emails_to;
|
||||
} else {
|
||||
$headers['Bcc'] = self::$bcc_all_emails_to;
|
||||
}
|
||||
}
|
||||
|
||||
Requirements::restore();
|
||||
@ -456,8 +462,8 @@ class Email extends ViewableData {
|
||||
unset($headers['Cc']);
|
||||
unset($headers['Bcc']);
|
||||
} else {
|
||||
if($this->cc) $headers["Cc"] = $this->cc;
|
||||
if($this->bcc) $headers["Bcc"] = $this->bcc;
|
||||
if($this->cc) $headers['Cc'] = $this->cc;
|
||||
if($this->bcc) $headers['Bcc'] = $this->bcc;
|
||||
}
|
||||
|
||||
if(self::$cc_all_emails_to) {
|
||||
|
Loading…
Reference in New Issue
Block a user