Skip to content

Commit 291dcac

Browse files
committed
Merge branch 'PHP-8.6'
* PHP-8.6: Fix GH-25737: mb_send_mail() ignores $additional_params (#25739)
2 parents cd96297 + 8bc8c3f commit 291dcac

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

‎ext/mbstring/mbstring.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4885,7 +4885,7 @@ PHP_FUNCTION(mb_send_mail)
48854885

48864886
str_headers = smart_str_extract(&str);
48874887

4888-
zend_string *force_extra_parameters = zend_ini_str_literal("mail.force_extra_parameters");
4888+
zend_string *force_extra_parameters = zend_ini_str_ex(ZEND_STRL("mail.force_extra_parameters"), false, NULL);
48894889
if (force_extra_parameters) {
48904890
extra_cmd = php_escape_shell_cmd(force_extra_parameters);
48914891
} else if (extra_cmd) {

‎ext/mbstring/tests/gh25737.phpt‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
--TEST--
2+
GH-25737 (mb_send_mail() ignores $additional_params)
3+
--EXTENSIONS--
4+
mbstring
5+
--SKIPIF--
6+
<?php
7+
if (PHP_OS_FAMILY === "Windows") die("skip Won't run on Windows");
8+
?>
9+
--INI--
10+
sendmail_path="cat > /dev/null; echo sendmail arguments:"
11+
--FILE--
12+
<?php
13+
var_dump(mb_send_mail("user@example.com", "subject", "message", [], "-fsender@example.com"));
14+
?>
15+
--EXPECT--
16+
sendmail arguments: -fsender@example.com
17+
bool(true)

0 commit comments

Comments
 (0)