Annotation of embedaddon/php/ext/imap/tests/bug35669.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #35669 (imap_mail_compose() crashes with multipart-multiboundary-email)
! 3: --SKIPIF--
! 4: <?php
! 5: if (!extension_loaded("imap")) {
! 6: die("skip imap extension not available");
! 7: }
! 8: ?>
! 9: --FILE--
! 10: <?php
! 11: $envelope["from"] = 'Santa <somewhere@northpole.gov>';
! 12: $envelope["to"] = 'The bad smurf <bad@smurf.com>';
! 13: $envelope['date'] = 'Wed, 04 Jan 2006 19:24:43 -0500';
! 14:
! 15: $multipart["type"] = TYPEMULTIPART;
! 16: $multipart["subtype"] = "MIXED";
! 17: $body[] = $multipart; //add multipart stuff
! 18:
! 19: $textpart["type"] = TYPEMULTIPART;
! 20: $textpart["subtype"] = "ALTERNATIVE";
! 21: $body[] = $textpart; //add body part
! 22:
! 23: $plain["type"] = TYPETEXT;
! 24: $plain["subtype"] = "PLAIN";
! 25: $plain["charset"] = "iso-8859-1";
! 26: $plain["encoding"] = ENCQUOTEDPRINTABLE;
! 27: $plain["description"] = "Plaintype part of message";
! 28: $plain['disposition'] = "inline";
! 29: $plain["contents.data"] = 'See mom, it will crash';
! 30:
! 31: $body[] = $plain; //next add plain text part
! 32:
! 33: $html["type"] = TYPETEXT;
! 34: $html["subtype"] = "HTML";
! 35: $html["charset"] = "iso-8859-1";
! 36: $html["encoding"] = ENCQUOTEDPRINTABLE;
! 37: $html["description"] = "HTML part of message";
! 38: $html['disposition'] = "inline";
! 39: $html["contents.data"] = 'See mom, it will <b>crash</b>';
! 40:
! 41: $body[] = $html;
! 42:
! 43: echo imap_mail_compose($envelope, $body);
! 44: ?>
! 45: --EXPECTF--
! 46: Date: Wed, 04 Jan 2006 19:24:43 -0500
! 47: From: Santa <somewhere@northpole.gov>
! 48: To: The bad smurf <bad@smurf.com>
! 49: MIME-Version: 1.0
! 50: Content-Type: MULTIPART/MIXED; BOUNDARY="%s"
! 51:
! 52: --%s
! 53: Content-Type: TEXT/ALTERNATIVE; CHARSET=US-ASCII
! 54:
! 55:
! 56: --%s
! 57: Content-Type: TEXT/PLAIN; CHARSET=iso-8859-1
! 58: Content-Transfer-Encoding: QUOTED-PRINTABLE
! 59: Content-Description: Plaintype part of message
! 60:
! 61: See mom, it will crash
! 62: --%s
! 63: Content-Type: TEXT/HTML; CHARSET=iso-8859-1
! 64: Content-Transfer-Encoding: QUOTED-PRINTABLE
! 65: Content-Description: HTML part of message
! 66:
! 67: See mom, it will <b>crash</b>
! 68: --%s--
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>