|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2016-04-13 14:59 UTC] jochem dot blok at fasterforward dot nl
Description:
------------
While parsing the addresslist from a mime mail the mailparse_rfc822_parse_addresses is used to split the name from the address. This function removes a space which is in the name.
Test script:
---------------
$a = mailparse_rfc822_parse_addresses('Foo Bar é [TEST] <foo@bar.com>');
var_dump($a);
Expected result:
----------------
array(1) {
[0]=>
array(3) {
["display"]=>
string(17) "Foo Bar é [TEST]"
["address"]=>
string(11) "foo@bar.com"
["is_group"]=>
bool(false)
}
}
Actual result:
--------------
array(1) {
[0]=>
array(3) {
["display"]=>
string(16) "Foo Bar é[TEST]"
["address"]=>
string(11) "foo@bar.com"
["is_group"]=>
bool(false)
}
}
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 17 06:00:01 2025 UTC |
I can confirm the reported behavior. However, this is an invalid email address according to RFC 822 and 2822, since neither spaces nor brackets are valid dot-atoms, and the local part is not and does not contain quoted-strings. The proper address '"Foo Bar é [TEST]" <foo@bar.com>' is parsed as expected, as well as the obsolete variant 'Foo Bar é "[TEST]" <foo@bar.com>' Anyhow, the parser should not return the actual result, at least not without signalling some kind of failure.