summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2011-08-09 09:53:37 +0000
committeralecpl <alec@alec.pl>2011-08-09 09:53:37 +0000
commit2185899721b227897f6a7739e223b48fe5f9baf7 (patch)
treeba6756ad1a1ff8b8ce26921b23da5e4b4dfa2ff7
parent6d0ada30d7847a509db10d819020ac653597d073 (diff)
- Fix handling of email addresses with quoted local part (#1487939)
-rw-r--r--program/include/rcube_imap.php2
-rw-r--r--tests/maildecode.php4
2 files changed, 5 insertions, 1 deletions
diff --git a/program/include/rcube_imap.php b/program/include/rcube_imap.php
index 5fbf3ad54..e31fb887e 100644
--- a/program/include/rcube_imap.php
+++ b/program/include/rcube_imap.php
@@ -4772,7 +4772,7 @@ class rcube_imap
$address = $m[2];
$name = trim($m[1]);
}
- else if (preg_match('/^(\S+@\S+)$/', $val, $m)) {
+ else if (preg_match('/^('.$email_rx.')$/', $val, $m)) {
$address = $m[1];
$name = '';
}
diff --git a/tests/maildecode.php b/tests/maildecode.php
index ef3d18246..7d67352c3 100644
--- a/tests/maildecode.php
+++ b/tests/maildecode.php
@@ -46,6 +46,8 @@ class rcube_test_maildecode extends UnitTestCase
18 => '"Test,Test" <test@domain.tld>',
// 1487939
19 => 'Test <"test test"@domain.tld>',
+ 20 => '<"test test"@domain.tld>',
+ 21 => '"test test"@domain.tld',
);
$results = array(
@@ -69,6 +71,8 @@ class rcube_test_maildecode extends UnitTestCase
17 => array(1, '', 'test@domain.tld'),
18 => array(1, 'Test,Test', 'test@domain.tld'),
19 => array(1, 'Test', '"test test"@domain.tld'),
+ 20 => array(1, '', '"test test"@domain.tld'),
+ 21 => array(1, '', '"test test"@domain.tld'),
);
foreach ($headers as $idx => $header) {