1
0
mirror of https://github.com/php/php-src.git synced 2026-04-25 08:58:28 +02:00

Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix #54298: Using empty additional_headers adding extraneous CRLF
This commit is contained in:
Christoph M. Becker
2020-01-06 14:48:22 +01:00
3 changed files with 27 additions and 1 deletions
+2
View File
@@ -82,6 +82,8 @@ PHP NEWS
- Standard:
. Fixed bug #79000 (Non-blocking socket stream reports EAGAIN as error).
(Nikita)
. Fixed bug #54298 (Using empty additional_headers adding extraneous CRLF).
(cmb)
18 Dec 2019, PHP 7.4.1
+1 -1
View File
@@ -368,7 +368,7 @@ PHP_FUNCTION(mail)
extra_cmd = php_escape_shell_cmd(ZSTR_VAL(extra_cmd));
}
if (php_mail(to_r, subject_r, message, str_headers ? ZSTR_VAL(str_headers) : NULL, extra_cmd ? ZSTR_VAL(extra_cmd) : NULL)) {
if (php_mail(to_r, subject_r, message, str_headers && ZSTR_LEN(str_headers) ? ZSTR_VAL(str_headers) : NULL, extra_cmd ? ZSTR_VAL(extra_cmd) : NULL)) {
RETVAL_TRUE;
} else {
RETVAL_FALSE;
+24
View File
@@ -0,0 +1,24 @@
--TEST--
Bug #54298 (Using empty additional_headers adding extraneous CRLF)
--INI--
sendmail_path=tee bug54298.eml >/dev/null
mail.add_x_header = Off
--SKIPIF--
<?php
if (PHP_OS_FAMILY === 'Windows') die("skip Won't run on Windows");
?>
--FILE--
<?php
var_dump(mail('someuser@example.com', 'testsubj', 'Body part', ''));
echo file_get_contents('bug54298.eml');
?>
--EXPECT--
bool(true)
To: someuser@example.com
Subject: testsubj
Body part
--CLEAN--
<?php
unlink('bug54298.eml');
?>