@@ -3724,15 +3724,19 @@ PHP_FUNCTION(imap_mail_compose)
3724
3724
bod -> disposition .parameter = disp_param ;
3725
3725
}
3726
3726
}
3727
- if ((pvalue = zend_hash_str_find (Z_ARRVAL_P (data ), "contents.data" , sizeof ("contents.data" ) - 1 )) != NULL ) {
3728
- convert_to_string_ex (pvalue );
3729
- bod -> contents .text .data = fs_get (Z_STRLEN_P (pvalue ) + 1 );
3730
- memcpy (bod -> contents .text .data , Z_STRVAL_P (pvalue ), Z_STRLEN_P (pvalue )+ 1 );
3731
- bod -> contents .text .size = Z_STRLEN_P (pvalue );
3727
+ if (bod -> type == TYPEMESSAGE && bod -> subtype && !strcmp (bod -> subtype , "RFC822" )) {
3728
+ bod -> nested .msg = mail_newmsg ();
3732
3729
} else {
3733
- bod -> contents .text .data = fs_get (1 );
3734
- memcpy (bod -> contents .text .data , "" , 1 );
3735
- bod -> contents .text .size = 0 ;
3730
+ if ((pvalue = zend_hash_str_find (Z_ARRVAL_P (data ), "contents.data" , sizeof ("contents.data" ) - 1 )) != NULL ) {
3731
+ convert_to_string_ex (pvalue );
3732
+ bod -> contents .text .data = fs_get (Z_STRLEN_P (pvalue ) + 1 );
3733
+ memcpy (bod -> contents .text .data , Z_STRVAL_P (pvalue ), Z_STRLEN_P (pvalue )+ 1 );
3734
+ bod -> contents .text .size = Z_STRLEN_P (pvalue );
3735
+ } else {
3736
+ bod -> contents .text .data = fs_get (1 );
3737
+ memcpy (bod -> contents .text .data , "" , 1 );
3738
+ bod -> contents .text .size = 0 ;
3739
+ }
3736
3740
}
3737
3741
if ((pvalue = zend_hash_str_find (Z_ARRVAL_P (data ), "lines" , sizeof ("lines" ) - 1 )) != NULL ) {
3738
3742
bod -> size .lines = zval_get_long (pvalue );
@@ -3951,7 +3955,7 @@ PHP_FUNCTION(imap_mail_compose)
3951
3955
efree (mystring );
3952
3956
mystring = tempstring ;
3953
3957
} else if (bod ) {
3954
- spprintf (& tempstring , 0 , "%s%s%s" , mystring , bod -> contents .text .data , CRLF );
3958
+ spprintf (& tempstring , 0 , "%s%s%s" , mystring , bod -> contents .text .data ? bod -> contents . text . data : "" , CRLF );
3955
3959
efree (mystring );
3956
3960
mystring = tempstring ;
3957
3961
} else {
0 commit comments