Bug #69874 [NEW]: Can't set empty additional_headers for mail()
| From: | buglloc at yandex dot ru | Date: | Thu, 18 Jun 2015 14:17:34 +0000 |
| Subject: | Bug #69874 [NEW]: Can't set empty additional_headers for mail() | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-193660@lists.php.net to get a copy of this message | ||
From: buglloc at yandex dot ru
Operating system: Linux
PHP version: 5.6.10
Package: Mail related
Bug Type: Bug
Bug description:Can't set empty additional_headers for mail()
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 bug report at https://bugs.php.net/bug.php?id=69874&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=69874&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=69874&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=69874&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=69874&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=69874&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=69874&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=69874&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=69874&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=69874&r=support
Expected behavior: https://bugs.php.net/fix.php?id=69874&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=69874&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=69874&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=69874&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=69874&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=69874&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=69874&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=69874&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=69874&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=69874&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=69874&r=mysqlcfg