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:
@@ -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
@@ -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;
|
||||
|
||||
@@ -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');
|
||||
?>
|
||||
Reference in New Issue
Block a user