|
2 | 2 | Bug #35669 (imap_mail_compose() crashes with multipart-multiboundary-email)
|
3 | 3 | --SKIPIF--
|
4 | 4 | <?php
|
5 |
| - if (!extension_loaded("imap")) { |
6 |
| - die("skip imap extension not available"); |
7 |
| - } |
| 5 | +extension_loaded('imap') or die('skip imap extension not available in this build'); |
8 | 6 | ?>
|
9 | 7 | --FILE--
|
10 | 8 | <?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'; |
| 9 | +$envelope["from"] = 'Santa <somewhere@northpole.gov>'; |
| 10 | +$envelope["to"] = 'The bad smurf <bad@smurf.com>'; |
| 11 | +$envelope['date'] = 'Wed, 04 Jan 2006 19:24:43 -0500'; |
14 | 12 |
|
15 |
| - $multipart["type"] = TYPEMULTIPART; |
16 |
| - $multipart["subtype"] = "MIXED"; |
17 |
| - $body[] = $multipart; //add multipart stuff |
| 13 | +$multipart["type"] = TYPEMULTIPART; |
| 14 | +$multipart["subtype"] = "MIXED"; |
| 15 | +$body[] = $multipart; //add multipart stuff |
18 | 16 |
|
19 |
| - $textpart["type"] = TYPEMULTIPART; |
20 |
| - $textpart["subtype"] = "ALTERNATIVE"; |
21 |
| - $body[] = $textpart; //add body part |
| 17 | +$textpart["type"] = TYPEMULTIPART; |
| 18 | +$textpart["subtype"] = "ALTERNATIVE"; |
| 19 | +$body[] = $textpart; //add body part |
22 | 20 |
|
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'; |
| 21 | +$plain["type"] = TYPETEXT; |
| 22 | +$plain["subtype"] = "PLAIN"; |
| 23 | +$plain["charset"] = "iso-8859-1"; |
| 24 | +$plain["encoding"] = ENCQUOTEDPRINTABLE; |
| 25 | +$plain["description"] = "Plaintype part of message"; |
| 26 | +$plain['disposition'] = "inline"; |
| 27 | +$plain["contents.data"] = 'See mom, it will crash'; |
30 | 28 |
|
31 |
| - $body[] = $plain; //next add plain text part |
| 29 | +$body[] = $plain; //next add plain text part |
32 | 30 |
|
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>'; |
| 31 | +$html["type"] = TYPETEXT; |
| 32 | +$html["subtype"] = "HTML"; |
| 33 | +$html["charset"] = "iso-8859-1"; |
| 34 | +$html["encoding"] = ENCQUOTEDPRINTABLE; |
| 35 | +$html["description"] = "HTML part of message"; |
| 36 | +$html['disposition'] = "inline"; |
| 37 | +$html["contents.data"] = 'See mom, it will <b>crash</b>'; |
40 | 38 |
|
41 |
| - $body[] = $html; |
| 39 | +$body[] = $html; |
42 | 40 |
|
43 |
| - echo imap_mail_compose($envelope, $body); |
| 41 | +echo imap_mail_compose($envelope, $body); |
44 | 42 | ?>
|
45 | 43 | --EXPECTF--
|
46 | 44 | Date: Wed, 04 Jan 2006 19:24:43 -0500
|
|
0 commit comments