From: Ilia Alshanetsky Date: Wed, 21 Sep 2005 13:19:19 +0000 (+0000) Subject: MFH: Fixed bug #34565 (mb_send_mail does not fetch mail.force_extra_parameters) X-Git-Tag: php-4.4.1RC1~20 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=27f3e6e91bb72940c8707cfc4003584b10c5e755;p=php MFH: Fixed bug #34565 (mb_send_mail does not fetch mail.force_extra_parameters) --- diff --git a/NEWS b/NEWS index d6e22e998f..1026216968 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,8 @@ PHP 4 NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? 2005, Version 4.4.1 - Added "new_link" parameter to mssql_connect(). Bug #34369. (Frank) +- Fixed bug #34565 (mb_send_mail does not fetch mail.force_extra_parameters). + (Marco, Ilia) - Fixed bug #34456 (Possible crash inside pspell extension). (Nuno) - Fixed bug #34311 (unserialize() crashes with chars above 191 dec). (Nuno) - Fixed bug #34307 (on_modify handler not called to set the default value if diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c index 5c9cca4ad9..89adfb9c66 100644 --- a/ext/mbstring/mbstring.c +++ b/ext/mbstring/mbstring.c @@ -55,6 +55,7 @@ #include "mbstring.h" #include "ext/standard/php_string.h" #include "ext/standard/php_mail.h" +#include "ext/standard/exec.h" #include "ext/standard/url.h" #include "main/php_output.h" #include "ext/standard/info.h" @@ -3473,6 +3474,7 @@ PHP_FUNCTION(mb_send_mail) body_enc; /* body transfar encoding */ mbfl_memory_device device; /* automatic allocateable buffer for additional header */ const mbfl_language *lang; + char *force_extra_parameters = INI_STR("mail.force_extra_parameters"); int err = 0; /* initialize */ @@ -3594,12 +3596,21 @@ PHP_FUNCTION(mb_send_mail) extra_cmd = Z_STRVAL_PP(argv[4]); } + 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); }