summaryrefslogtreecommitdiff
path: root/ext/imap/tests/bug80220.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/imap/tests/bug80220.phpt')
-rw-r--r--ext/imap/tests/bug80220.phpt34
1 files changed, 34 insertions, 0 deletions
diff --git a/ext/imap/tests/bug80220.phpt b/ext/imap/tests/bug80220.phpt
new file mode 100644
index 0000000000..0d3e3eda9b
--- /dev/null
+++ b/ext/imap/tests/bug80220.phpt
@@ -0,0 +1,34 @@
+--TEST--
+Bug #80220 (imap_mail_compose() may leak memory) - message/rfc822 regression
+--SKIPIF--
+<?php
+if (!extension_loaded('imap')) die('skip imap extension not available');
+?>
+--FILE--
+<?php
+$bodies = [[
+ 'type' => TYPEMESSAGE,
+ 'subtype' => 'RFC822',
+], [
+ 'contents.data' => 'asd',
+]];
+var_dump(imap_mail_compose([], $bodies));
+
+$bodies = [[
+ 'type' => TYPEMESSAGE,
+], [
+ 'contents.data' => 'asd',
+]];
+var_dump(imap_mail_compose([], $bodies));
+?>
+--EXPECT--
+string(53) "MIME-Version: 1.0
+Content-Type: MESSAGE/RFC822
+
+
+"
+string(53) "MIME-Version: 1.0
+Content-Type: MESSAGE/RFC822
+
+
+"