Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed Bug #19094: Email addresses do not have to contain a space betw…

…een name and address parts
  • Loading branch information...
commit f7f897ea59d4dd0fdb7494b6cc5f0344a4d50c21 1 parent d592e33
@alecpl alecpl authored
View
2  Mail/MimePart2.php
@@ -803,7 +803,7 @@ function encodeHeader($name, $value, $charset='ISO-8859-1',
// Structured header (make sure addr-spec inside is not encoded)
if (!empty($separator)) {
// Simple e-mail address regexp
- $email_regexp = '(\S+|("[^\r\n"]+"))@\S+';
+ $email_regexp = '([^\s<]+|("[^\r\n"]+"))@\S+';
$parts = Mail_MimePart2::_explodeQuotedString($separator, $value);
$value = '';
View
6 tests/headers_with_mbstring.phpt
@@ -38,6 +38,8 @@ array('From', "test@nàme <user@domain.com>"),
array('From', "Test <\"test test\"@domain.com>"),
array('From', "\"test test\"@domain.com"),
array('From', "<\"test test\"@domain.com>"),
+array('From', "Doe<test@domain.com>"),
+array('From', "\"John Doe\"<test@domain.com>"),
);
$i = 1;
@@ -134,3 +136,7 @@ foreach ($headers as $header) {
[25] From: "test test"@domain.com
[26] From: <"test test"@domain.com>
[26] From: <"test test"@domain.com>
+[27] From: Doe <test@domain.com>
+[27] From: Doe <test@domain.com>
+[28] From: "John Doe" <test@domain.com>
+[28] From: "John Doe" <test@domain.com>
View
6 tests/headers_without_mbstring.phpt
@@ -38,6 +38,8 @@ array('From', "test@nàme <user@domain.com>"),
array('From', "Test <\"test test\"@domain.com>"),
array('From', "\"test test\"@domain.com"),
array('From', "<\"test test\"@domain.com>"),
+array('From', "Doe<test@domain.com>"),
+array('From', "\"John Doe\"<test@domain.com>"),
);
$i = 1;
@@ -135,3 +137,7 @@ foreach ($headers as $header) {
[25] From: "test test"@domain.com
[26] From: <"test test"@domain.com>
[26] From: <"test test"@domain.com>
+[27] From: Doe <test@domain.com>
+[27] From: Doe <test@domain.com>
+[28] From: "John Doe" <test@domain.com>
+[28] From: "John Doe" <test@domain.com>

0 comments on commit f7f897e

Please sign in to comment.
Something went wrong with that request. Please try again.