diff options
author | Michael Hamann <michael@content-space.de> | 2013-12-01 21:25:29 +0100 |
---|---|---|
committer | Michael Hamann <michael@content-space.de> | 2013-12-01 21:27:49 +0100 |
commit | 6be717dbb579e1cc7e2fbb82d7ddade3e5892c47 (patch) | |
tree | f9bc76ab7c6226a41300b5f9f9f932bc9c397b01 /inc | |
parent | 06ba6baf09df8e3379597f5107bd773c781995d6 (diff) | |
download | rpg-6be717dbb579e1cc7e2fbb82d7ddade3e5892c47.tar.gz rpg-6be717dbb579e1cc7e2fbb82d7ddade3e5892c47.tar.bz2 |
Fix sending empty and duplicated headers, FS#2887
This fixes sending empty and duplicated To/Cc/Bcc, Subject and From
headers in the additional headers. The To-header in the additional
headers prevented mail sending on some systems.
Diffstat (limited to 'inc')
-rw-r--r-- | inc/Mailer.class.php | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/inc/Mailer.class.php b/inc/Mailer.class.php index 186bd531a..2ac2c1d60 100644 --- a/inc/Mailer.class.php +++ b/inc/Mailer.class.php @@ -576,7 +576,7 @@ class Mailer { protected function prepareHeaders() { $headers = ''; foreach($this->headers as $key => $val) { - if ($val === '') continue; + if ($val === '' || is_null($val)) continue; $headers .= $this->wrappedHeaderLine($key, $val); } return $headers; @@ -640,16 +640,16 @@ class Mailer { ) return false; // The To: header is special - if(isset($this->headers['To'])) { - $to = $this->headers['To']; + if(array_key_exists('To', $this->headers)) { + $to = (string)$this->headers['To']; unset($this->headers['To']); } else { $to = ''; } // so is the subject - if(isset($this->headers['Subject'])) { - $subject = $this->headers['Subject']; + if(array_key_exists('Subject', $this->headers)) { + $subject = (string)$this->headers['Subject']; unset($this->headers['Subject']); } else { $subject = ''; |