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