]> 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:19:19 +0000 (13:19 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Wed, 21 Sep 2005 13:19:19 +0000 (13:19 +0000)
NEWS
ext/mbstring/mbstring.c

diff --git a/NEWS b/NEWS
index d6e22e998f8be360978d3a6a8875190ac4bfc07c..1026216968d592a24751648f8972229581de38de 100644 (file)
--- 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
index 5c9cca4ad9599b0c73879c7912842208a240a3c5..89adfb9c669f50572fc1076857f37775f78d972c 100644 (file)
@@ -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);
        }