php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #69874 Can't set empty additional_headers for mail()
Submitted: 2015-06-18 14:17 UTC Modified: 2015-06-19 03:23 UTC
Votes:7
Avg. Score:5.0 ± 0.0
Reproduced:7 of 7 (100.0%)
Same Version:5 (71.4%)
Same OS:7 (100.0%)
From: buglloc at yandex dot ru Assigned: yohgaki
Status: Closed Package: Mail related
PHP Version: 5.6.10 OS: Linux
Private report: No CVE-ID:
 [2015-06-18 14:17 UTC] 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)


Patches

disable-checking-empty-mail-headers.patch (last revision 2015-06-18 14:18 UTC) by buglloc at yandex dot ru)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-06-18 19:08 UTC] cmb@php.net
-Status: Open +Status: Verified -Assigned To: +Assigned To: yohgaki
 [2015-06-18 19:08 UTC] cmb@php.net
Yasuo, can you please have a look at this issue?
 [2015-06-19 02:48 UTC] yohgaki@php.net
Sure
 [2015-06-19 03:23 UTC] yohgaki@php.net
This is the PR that fixes this bug.
https://github.com/php/php-src/pull/1350
 [2015-06-29 07:32 UTC] stas@php.net
Automatic comment on behalf of yohgaki
Revision: http://git.php.net/?p=php-src.git;a=commit;h=dacea3f6fb3f84c79a3412b24547eb2c636754f6
Log: Fixed Bug #69874 : Can't set empty additional_headers for mail()
 [2015-06-29 07:32 UTC] stas@php.net
-Status: Verified +Status: Closed
 [2015-07-07 23:37 UTC] ab@php.net
Automatic comment on behalf of yohgaki
Revision: http://git.php.net/?p=php-src.git;a=commit;h=dacea3f6fb3f84c79a3412b24547eb2c636754f6
Log: Fixed Bug #69874 : Can't set empty additional_headers for mail()
 [2015-07-08 14:56 UTC] jpauli@php.net
Automatic comment on behalf of yohgaki
Revision: http://git.php.net/?p=php-src.git;a=commit;h=dacea3f6fb3f84c79a3412b24547eb2c636754f6
Log: Fixed Bug #69874 : Can't set empty additional_headers for mail()
 [2015-07-10 00:53 UTC] tyrael@php.net
Automatic comment on behalf of yohgaki
Revision: http://git.php.net/?p=php-src.git;a=commit;h=145c6167619b7a2102843d4363337b55bc9916ff
Log: Fixed Bug #69874 : Can't set empty additional_headers for mail()
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Tue Aug 29 15:01:52 2017 UTC