@@ -3263,15 +3263,19 @@ PHP_FUNCTION(imap_mail_compose)
3263
3263
bod -> disposition .parameter = disp_param ;
3264
3264
}
3265
3265
}
3266
- if ((pvalue = zend_hash_str_find (Z_ARRVAL_P (data ), "contents.data" , sizeof ("contents.data" ) - 1 )) != NULL ) {
3267
- convert_to_string_ex (pvalue );
3268
- bod -> contents .text .data = fs_get (Z_STRLEN_P (pvalue ) + 1 );
3269
- memcpy (bod -> contents .text .data , Z_STRVAL_P (pvalue ), Z_STRLEN_P (pvalue )+ 1 );
3270
- bod -> contents .text .size = Z_STRLEN_P (pvalue );
3266
+ if (bod -> type == TYPEMESSAGE && bod -> subtype && !strcmp (bod -> subtype , "RFC822" )) {
3267
+ bod -> nested .msg = mail_newmsg ();
3271
3268
} else {
3272
- bod -> contents .text .data = fs_get (1 );
3273
- memcpy (bod -> contents .text .data , "" , 1 );
3274
- bod -> contents .text .size = 0 ;
3269
+ if ((pvalue = zend_hash_str_find (Z_ARRVAL_P (data ), "contents.data" , sizeof ("contents.data" ) - 1 )) != NULL ) {
3270
+ convert_to_string_ex (pvalue );
3271
+ bod -> contents .text .data = fs_get (Z_STRLEN_P (pvalue ) + 1 );
3272
+ memcpy (bod -> contents .text .data , Z_STRVAL_P (pvalue ), Z_STRLEN_P (pvalue )+ 1 );
3273
+ bod -> contents .text .size = Z_STRLEN_P (pvalue );
3274
+ } else {
3275
+ bod -> contents .text .data = fs_get (1 );
3276
+ memcpy (bod -> contents .text .data , "" , 1 );
3277
+ bod -> contents .text .size = 0 ;
3278
+ }
3275
3279
}
3276
3280
if ((pvalue = zend_hash_str_find (Z_ARRVAL_P (data ), "lines" , sizeof ("lines" ) - 1 )) != NULL ) {
3277
3281
bod -> size .lines = zval_get_long (pvalue );
@@ -3491,7 +3495,7 @@ PHP_FUNCTION(imap_mail_compose)
3491
3495
efree (mystring );
3492
3496
mystring = tempstring ;
3493
3497
} else if (bod ) {
3494
- spprintf (& tempstring , 0 , "%s%s%s" , mystring , bod -> contents .text .data , CRLF );
3498
+ spprintf (& tempstring , 0 , "%s%s%s" , mystring , bod -> contents .text .data ? bod -> contents . text . data : "" , CRLF );
3495
3499
efree (mystring );
3496
3500
mystring = tempstring ;
3497
3501
} else {
0 commit comments