From: Ilia Alshanetsky Date: Wed, 21 Sep 2005 13:15:20 +0000 (+0000) Subject: Fixed bug #34565 (mb_send_mail does not fetch mail.force_extra_parameters) X-Git-Tag: RELEASE_0_9_0~154 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=db186add458a337927f57057774b789c70cebf00;p=php Fixed bug #34565 (mb_send_mail does not fetch mail.force_extra_parameters) --- diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c index 0b7534a967..2a453778fe 100644 --- a/ext/mbstring/mbstring.c +++ b/ext/mbstring/mbstring.c @@ -3007,6 +3007,7 @@ PHP_FUNCTION(mb_send_mail) int subject_len; char *extra_cmd=NULL; int extra_cmd_len; + char *force_extra_parameters = INI_STR("mail.force_extra_parameters"); struct { int cnt_type:1; int cnt_trans_enc:1; @@ -3208,12 +3209,21 @@ PHP_FUNCTION(mb_send_mail) mbfl_memory_device_output('\0', &device); headers = (char *)device.buffer; + if (force_extra_parameters) { + extra_cmd = estrdup(force_extra_parameters); + } else if (extra_cmd) { + extra_cmd = php_escape_shell_cmd(extra_cmd); + } + if (!err && php_mail(to, subject, message, headers, extra_cmd TSRMLS_CC)) { RETVAL_TRUE; } else { RETVAL_FALSE; } + if (extra_cmd) { + efree(extra_cmd); + } if (subject_buf) { efree((void *)subject_buf); }