summaryrefslogtreecommitdiff
path: root/_test
diff options
context:
space:
mode:
authorDominik Eckelmann <deckelmann@gmail.com>2012-11-23 18:48:09 +0100
committerDominik Eckelmann <deckelmann@gmail.com>2012-11-23 18:48:09 +0100
commit1f61f312a78e212aaa4a4bc3f60961036ec07fd7 (patch)
tree765327c215ad3871dca18c8720beb27f9fcda056 /_test
parent78f0e83246184ff6cb8679d086b0fa17ab508057 (diff)
downloadrpg-1f61f312a78e212aaa4a4bc3f60961036ec07fd7.tar.gz
rpg-1f61f312a78e212aaa4a4bc3f60961036ec07fd7.tar.bz2
remove empty BCC/CC mail headers
Empty BCC/CC headers may cause errors on IIS.
Diffstat (limited to '_test')
-rw-r--r--_test/tests/inc/mailer.test.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/_test/tests/inc/mailer.test.php b/_test/tests/inc/mailer.test.php
index b2c74a257..91c4a999d 100644
--- a/_test/tests/inc/mailer.test.php
+++ b/_test/tests/inc/mailer.test.php
@@ -7,6 +7,14 @@ class TestMailer extends Mailer {
public function prop($name){
return $this->$name;
}
+
+ public function &propRef($name) {
+ return $this->$name;
+ }
+
+ public function prepareHeaders() {
+ return parent::prepareHeaders();
+ }
}
class mailer_test extends DokuWikiTest {
@@ -90,5 +98,14 @@ class mailer_test extends DokuWikiTest {
}
}
+ function test_emptyBCCorCC() {
+ $mail = new TestMailer();
+ $headers = &$mail->propRef('headers');
+ $headers['Bcc'] = '';
+ $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.');
+ }
}
//Setup VIM: ex: et ts=4 :