diff options
author | Andreas Gohr <andi@splitbrain.org> | 2013-12-03 09:38:26 -0800 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2013-12-03 09:38:26 -0800 |
commit | 43a8543d8365cccab1845958a180d6374e67172f (patch) | |
tree | 2e8bc6d3778306805842fa5fdb89369338448471 /_test/tests/inc | |
parent | 93327317c1e6ba43238660de04cfa7e94c51c2b7 (diff) | |
parent | 6be717dbb579e1cc7e2fbb82d7ddade3e5892c47 (diff) | |
download | rpg-43a8543d8365cccab1845958a180d6374e67172f.tar.gz rpg-43a8543d8365cccab1845958a180d6374e67172f.tar.bz2 |
Merge pull request #461 from splitbrain/mail_headers
Fix sending empty and duplicated headers, FS#2887
Diffstat (limited to '_test/tests/inc')
-rw-r--r-- | _test/tests/inc/mailer.test.php | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/_test/tests/inc/mailer.test.php b/_test/tests/inc/mailer.test.php index bac0c39ba..4541d9906 100644 --- a/_test/tests/inc/mailer.test.php +++ b/_test/tests/inc/mailer.test.php @@ -154,7 +154,19 @@ class mailer_test extends DokuWikiTest { $headers['Cc'] = ''; $header = $mail->prepareHeaders(); $this->assertEquals(0, preg_match('/(^|\n)Bcc: (\n|$)/', $header), 'Bcc found in headers.'); - $this->assertEquals(0, preg_match('/(^|\n)Cc: (\n|$)/', $header), 'Bcc found in headers.'); + $this->assertEquals(0, preg_match('/(^|\n)Cc: (\n|$)/', $header), 'Cc found in headers.'); + } + + function test_nullTOorCCorBCC() { + $mail = new TestMailer(); + $headers = &$mail->propRef('headers'); + $headers['Bcc'] = NULL; + $headers['Cc'] = NULL; + $headers['To'] = NULL; + $header = $mail->prepareHeaders(); + $this->assertEquals(0, preg_match('/(^|\n)Bcc: (\n|$)/', $header), 'Bcc found in headers.'); + $this->assertEquals(0, preg_match('/(^|\n)Cc: (\n|$)/', $header), 'Cc found in headers.'); + $this->assertEquals(0, preg_match('/(^|\n)To: (\n|$)/', $header), 'To found in headers.'); } /** |