diff options
author | Dominik Eckelmann <deckelmann@gmail.com> | 2012-11-23 19:55:44 +0100 |
---|---|---|
committer | Dominik Eckelmann <deckelmann@gmail.com> | 2012-11-23 19:55:44 +0100 |
commit | 91effd8de07e4afc59b6763ac72b268f58cfc941 (patch) | |
tree | 01889658db289d00609170881cfbd9a6bb665c57 | |
parent | 1f61f312a78e212aaa4a4bc3f60961036ec07fd7 (diff) | |
download | rpg-91effd8de07e4afc59b6763ac72b268f58cfc941.tar.gz rpg-91effd8de07e4afc59b6763ac72b268f58cfc941.tar.bz2 |
ignore empty header on mail sending
-rw-r--r-- | _test/tests/inc/mailer.test.php | 3 | ||||
-rw-r--r-- | inc/Mailer.class.php | 12 |
2 files changed, 4 insertions, 11 deletions
diff --git a/_test/tests/inc/mailer.test.php b/_test/tests/inc/mailer.test.php index 91c4a999d..053e216b8 100644 --- a/_test/tests/inc/mailer.test.php +++ b/_test/tests/inc/mailer.test.php @@ -98,6 +98,9 @@ class mailer_test extends DokuWikiTest { } } + /** + * @see https://forum.dokuwiki.org/post/35822 + */ function test_emptyBCCorCC() { $mail = new TestMailer(); $headers = &$mail->propRef('headers'); diff --git a/inc/Mailer.class.php b/inc/Mailer.class.php index 256a76d22..f1492be9b 100644 --- a/inc/Mailer.class.php +++ b/inc/Mailer.class.php @@ -553,25 +553,15 @@ class Mailer { * @returns string the headers */ protected function prepareHeaders() { - $this->removeEmptyBccOrCcHeader(); $headers = ''; foreach($this->headers as $key => $val) { + if ($val === '') continue; $headers .= "$key: $val".MAILHEADER_EOL; } return $headers; } /** - * Removes empty BCC and CC Header. - * - * Empty BCC/CC Header can cause an error with Microsoft IIS. - */ - protected function removeEmptyBccOrCcHeader() { - if (isset($this->headers['Bcc']) && empty($this->headers['Bcc'])) unset($this->headers['Bcc']); - if (isset($this->headers['Cc']) && empty($this->headers['Cc'])) unset($this->headers['Cc']); - } - - /** * return a full email with all headers * * This is mainly intended for debugging and testing but could also be |