xref: /PHP-8.0/ext/imap/tests/bug32589.phpt (revision 5aaffc80)
1--TEST--
2Bug #32589 (crash inside imap_mail_compose() function)
3--SKIPIF--
4<?php
5extension_loaded('imap') or die('skip imap extension not available in this build');
6?>
7--FILE--
8<?php
9$m_envelope["To"] = "mail@example.com";
10$m_part1["type"] = TYPEMULTIPART;
11$m_part1["subtype"] = "mixed";
12$m_part2["type"] = TYPETEXT;
13$m_part2["subtype"] = "plain";
14$m_part2["description"] = "text_message";
15
16$m_part2["charset"] = "ISO-8859-2";
17
18$m_part2["contents.data"] = "hello";
19$m_body[1] = $m_part1;
20$m_body[2] = $m_part2;
21echo imap_mail_compose($m_envelope, $m_body);
22?>
23--EXPECTF--
24MIME-Version: 1.0
25Content-Type: MULTIPART/mixed; BOUNDARY="%s"
26
27%s
28Content-Type: TEXT/plain; CHARSET=ISO-8859-2
29Content-Description: text_message
30
31hello
32%s
33