bug35669.phpt 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. --TEST--
  2. Bug #35669 (imap_mail_compose() crashes with multipart-multiboundary-email)
  3. --EXTENSIONS--
  4. imap
  5. --FILE--
  6. <?php
  7. $envelope["from"] = 'Santa <somewhere@northpole.gov>';
  8. $envelope["to"] = 'The bad smurf <bad@smurf.com>';
  9. $envelope['date'] = 'Wed, 04 Jan 2006 19:24:43 -0500';
  10. $multipart["type"] = TYPEMULTIPART;
  11. $multipart["subtype"] = "MIXED";
  12. $body[] = $multipart; //add multipart stuff
  13. $textpart["type"] = TYPEMULTIPART;
  14. $textpart["subtype"] = "ALTERNATIVE";
  15. $body[] = $textpart; //add body part
  16. $plain["type"] = TYPETEXT;
  17. $plain["subtype"] = "PLAIN";
  18. $plain["charset"] = "iso-8859-1";
  19. $plain["encoding"] = ENCQUOTEDPRINTABLE;
  20. $plain["description"] = "Plaintype part of message";
  21. $plain['disposition'] = "inline";
  22. $plain["contents.data"] = 'See mom, it will crash';
  23. $body[] = $plain; //next add plain text part
  24. $html["type"] = TYPETEXT;
  25. $html["subtype"] = "HTML";
  26. $html["charset"] = "iso-8859-1";
  27. $html["encoding"] = ENCQUOTEDPRINTABLE;
  28. $html["description"] = "HTML part of message";
  29. $html['disposition'] = "inline";
  30. $html["contents.data"] = 'See mom, it will <b>crash</b>';
  31. $body[] = $html;
  32. echo imap_mail_compose($envelope, $body);
  33. ?>
  34. --EXPECTF--
  35. Date: Wed, 04 Jan 2006 19:24:43 -0500
  36. From: Santa <somewhere@northpole.gov>
  37. To: The bad smurf <bad@smurf.com>
  38. MIME-Version: 1.0
  39. Content-Type: MULTIPART/MIXED; BOUNDARY="%s"
  40. --%s
  41. Content-Type: TEXT/ALTERNATIVE; CHARSET=US-ASCII
  42. --%s
  43. Content-Type: TEXT/PLAIN; CHARSET=iso-8859-1
  44. Content-Transfer-Encoding: QUOTED-PRINTABLE
  45. Content-Description: Plaintype part of message
  46. See mom, it will crash
  47. --%s
  48. Content-Type: TEXT/HTML; CHARSET=iso-8859-1
  49. Content-Transfer-Encoding: QUOTED-PRINTABLE
  50. Content-Description: HTML part of message
  51. See mom, it will <b>crash</b>
  52. --%s--