mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-22 01:49:08 +01:00
LSaddon::mail: fix handling CC/BCC headers if not provided as array
This commit is contained in:
parent
62759330a8
commit
d26c52400e
1 changed files with 3 additions and 1 deletions
|
@ -229,6 +229,7 @@ function sendMail($to, $subject, $msg, $headers=null, $attachments=null,
|
||||||
|
|
||||||
foreach(array_keys($headers) as $header) {
|
foreach(array_keys($headers) as $header) {
|
||||||
if(in_array(strtoupper($header), array('BCC', 'CC'))) {
|
if(in_array(strtoupper($header), array('BCC', 'CC'))) {
|
||||||
|
$headers[$header] = ensureIsArray($headers[$header]);
|
||||||
if (isset($MAIL_CATCH_ALL) && $MAIL_CATCH_ALL) {
|
if (isset($MAIL_CATCH_ALL) && $MAIL_CATCH_ALL) {
|
||||||
$logger -> debug("Mail catched: remove $header header");
|
$logger -> debug("Mail catched: remove $header header");
|
||||||
$msg .= sprintf(
|
$msg .= sprintf(
|
||||||
|
@ -238,7 +239,8 @@ function sendMail($to, $subject, $msg, $headers=null, $attachments=null,
|
||||||
_("\n%s: %s")
|
_("\n%s: %s")
|
||||||
),
|
),
|
||||||
strtoupper($header),
|
strtoupper($header),
|
||||||
(is_array($headers[$header])?implode(',', $headers[$header]):$headers[$header]));
|
implode(', ', $headers[$header])
|
||||||
|
);
|
||||||
unset($headers[$header]);
|
unset($headers[$header]);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue