Bug #69874 [Ver]: Can't set empty additional_headers for mail()
| From: | yohgaki@php.net | Date: | Fri, 19 Jun 2015 02:49:00 +0000 |
| Subject: | Bug #69874 [Ver]: Can't set empty additional_headers for mail() | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-193676@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=69874&edit=1
ID: 69874
Updated by: yohgaki@php.net
Reported by: buglloc at yandex dot ru
Summary: Can't set empty additional_headers for mail()
Status: Verified
Type: Bug
Package: Mail related
Operating System: Linux
PHP Version: 5.6.10
Assigned To: yohgaki
Block user comment: N
Private report: N
New Comment:
Sure
Previous Comments:
------------------------------------------------------------------------
[2015-06-18 19:08:31] cmb@php.net
Yasuo, can you please have a look at this issue?
------------------------------------------------------------------------
[2015-06-18 14:17:33] buglloc at yandex dot ru
Description:
------------
After update to PHP 5.6.10 with fix https://bugs.php.net/bug.php?id=68776 i can't
set empty additional_headers for mail() function (i.e. if i want to set additional_parameters).
Test script:
---------------
echo 'without additional headers at all:';
var_dump(mail('to', 'subj', 'mess'));
echo 'with additional headers:';
var_dump(mail('to', 'subj', 'mess', 'X-Header: foo'));
echo 'with empty string as additional headers:';
var_dump(mail('to', 'subj', 'mess', ''));
echo 'with additional parameters and null as additional headers:';
var_dump(mail('to', 'subj', 'mess', null, 'foo'));
Expected result:
----------------
without additional headers at all:bool(true)
with additional headers:bool(true)
with empty string as additional headers:bool(true)
with additional parameters and null as additional headers:bool(true)
Actual result:
--------------
without additional headers at all:bool(true)
with additional headers:bool(true)
with empty string as additional headers:PHP Warning: mail(): Multiple or malformed newlines found
in additional_header in /tmp/test.php on line 9
Warning: mail(): Multiple or malformed newlines found in additional_header in /tmp/test.php on line
9
bool(false)
with additional parameters and null as additional headers:PHP Warning: mail(): Multiple or
malformed newlines found in additional_header in /tmp/test.php on line 11
Warning: mail(): Multiple or malformed newlines found in additional_header in /tmp/test.php on line
11
bool(false)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=69874&edit=1