diff options
Diffstat (limited to 'ext/imap/php_imap.c')
-rw-r--r-- | ext/imap/php_imap.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c index 4bfcafdad5..8602fb95d6 100644 --- a/ext/imap/php_imap.c +++ b/ext/imap/php_imap.c @@ -3147,12 +3147,15 @@ int _php_imap_mail(char *to, char *subject, char *message, char *headers, char * char *bufferTo = NULL, *bufferCc = NULL, *bufferBcc = NULL, *bufferHeader = NULL; int offset, bufferLen = 0;; - if (headers) + if (headers) { bufferLen += strlen(headers); - if (to) + } + if (to) { bufferLen += strlen(to) + 6; - if (cc) + } + if (cc) { bufferLen += strlen(cc) + 6; + } bufferHeader = (char *)emalloc(bufferLen); memset(bufferHeader, 0, bufferLen); @@ -3222,8 +3225,9 @@ int _php_imap_mail(char *to, char *subject, char *message, char *headers, char * } } - if (headers && *headers) + if (headers && *headers) { strcat(bufferHeader, headers); + } if (TSendMail(INI_STR("SMTP"), &tsm_err, &tsm_errmsg, bufferHeader, subject, bufferTo, message, bufferCc, bufferBcc, rpath) != SUCCESS) { if (tsm_errmsg) { |