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