]> granicus.if.org Git - php/commitdiff
MFH: Fixed bug #34565 (mb_send_mail does not fetch mail.force_extra_parameters)
authorIlia Alshanetsky <iliaa@php.net>
Wed, 21 Sep 2005 13:16:03 +0000 (13:16 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Wed, 21 Sep 2005 13:16:03 +0000 (13:16 +0000)
NEWS
ext/mbstring/mbstring.c

diff --git a/NEWS b/NEWS
index 581f0f8a2dc1fd0c068bb4bb2c7954982d89b54d..937cffed212b4993eac3e3f8356b704da035c521 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -33,6 +33,8 @@ PHP                                                                        NEWS
 - Fixed "make test" to work for phpized extensions. (Hartmut, Jani)
 - Fixed failing queries (FALSE returned) with mysqli_query() on 64 bit systems.
   (Andrey)
+- Fixed bug #34565 (mb_send_mail does not fetch mail.force_extra_parameters).
+  (Marco, Ilia)
 - Fixed bug #34518 (Unset doesn't separate container in CV). (Dmitry)
 - Fixed bug #34505 (Possible memory corruption when unmangling properties 
   with empty names). (Tony)
index 0b7534a967387d42b0c46209ba90ac0caaa04e05..2a453778fe65b573f3f40a2cacf023b888dff844 100644 (file)
@@ -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);
        }