Permalink
Browse files

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

…een the name and <> part
  • Loading branch information...
1 parent 602e11a commit f5cc863dc7af1aa89ccf1743679ab28e31e90f7b @alecpl alecpl committed Mar 12, 2012
Showing with 30 additions and 3 deletions.
  1. +1 −1 Mail/mimePart.php
  2. +17 −2 package.xml
  3. +6 −0 tests/headers_with_mbstring.phpt
  4. +6 −0 tests/headers_without_mbstring.phpt
View
@@ -807,7 +807,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_mimePart::_explodeQuotedString($separator, $value);
$value = '';
View
@@ -31,7 +31,7 @@ using RFC2047 and/or RFC2231.</description>
</lead>
<date>2012-01-01</date>
<version>
- <release>1.8.3</release>
+ <release>1.8.4</release>
<api>1.4.1</api>
</version>
<stability>
@@ -40,7 +40,7 @@ using RFC2047 and/or RFC2231.</description>
</stability>
<license uri="http://www.opensource.org/licenses/bsd-license.php">BSD Style</license>
<notes>
- * Request #19009: Remove error_reporting from tests [alec]
+ * Fixed Bug #19094: Email addresses do not have to contain a space between the name and <> part [alec]
</notes>
<contents>
<dir name="/">
@@ -618,5 +618,20 @@ Bugs Fixed:
* Fixed handling of email addresses with quoted local part [alec]
</notes>
</release>
+ <release>
+ <date>2012-01-01</date>
+ <version>
+ <release>1.8.3</release>
+ <api>1.4.1</api>
+ </version>
+ <stability>
+ <release>stable</release>
+ <api>stable</api>
+ </stability>
+ <license uri="http://www.opensource.org/licenses/bsd-license.php">BSD Style</license>
+ <notes>
+ * Request #19009: Remove error_reporting from tests [alec]
+ </notes>
+ </release>
</changelog>
</package>
@@ -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>
@@ -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 f5cc863

Please sign in to comment.