Commit 8bc8c3f94cf for php

commit 8bc8c3f94cf373dcf03add9982690aa224f6bb57
Author: Tomasz Kowalczyk <tomasz@kowalczyk.cc>
Date:   Wed Nov 25 14:11:36 2026 +0100

    Fix GH-25737: mb_send_mail() ignores $additional_params (#25739)

    Restore the previous INI lookup so that an unset mail.force_extra_parameters
    leaves $additional_params in effect. An explicitly empty setting still
    overrides $additional_params, preserving the PHP 8.5 behavior.

    Add a regression test that checks the argument passed to sendmail.

    Closes #25739

diff --git a/NEWS b/NEWS
index 55365b31983..4ac9fa5c510 100644
--- a/NEWS
+++ b/NEWS
@@ -110,6 +110,8 @@ PHP                                                                        NEWS
     deeply nested arrays. (Eyüp Can Akman)
   . Fixed the JIT freeing the string returned by mb_encode_mimeheader() or
     mb_output_handler() while it is still in use. (Ilia Alshanetsky)
+  . Fixed bug GH-25737 (mb_send_mail() ignores $additional_params).
+    (Tomasz Kowalczyk)

 - Opcache:
   . Fixed bug GH-22216 (spurious opcache.memory_consumption warning on each new
diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c
index d2e17d6c0bc..88e7d7f5f83 100644
--- a/ext/mbstring/mbstring.c
+++ b/ext/mbstring/mbstring.c
@@ -4848,7 +4848,7 @@ PHP_FUNCTION(mb_send_mail)

 	str_headers = smart_str_extract(&str);

-	zend_string *force_extra_parameters = zend_ini_str_literal("mail.force_extra_parameters");
+	zend_string *force_extra_parameters = zend_ini_str_ex(ZEND_STRL("mail.force_extra_parameters"), false, NULL);
 	if (force_extra_parameters) {
 		extra_cmd = php_escape_shell_cmd(force_extra_parameters);
 	} else if (extra_cmd) {
diff --git a/ext/mbstring/tests/gh25737.phpt b/ext/mbstring/tests/gh25737.phpt
new file mode 100644
index 00000000000..6118c812b35
--- /dev/null
+++ b/ext/mbstring/tests/gh25737.phpt
@@ -0,0 +1,17 @@
+--TEST--
+GH-25737 (mb_send_mail() ignores $additional_params)
+--EXTENSIONS--
+mbstring
+--SKIPIF--
+<?php
+if (PHP_OS_FAMILY === "Windows") die("skip Won't run on Windows");
+?>
+--INI--
+sendmail_path="cat > /dev/null; echo sendmail arguments:"
+--FILE--
+<?php
+var_dump(mb_send_mail("user@example.com", "subject", "message", [], "-fsender@example.com"));
+?>
+--EXPECT--
+sendmail arguments: -fsender@example.com
+bool(true)