summaryrefslogtreecommitdiff
path: root/roundcubemail/program/include/rcube_imap.php
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-03-12 13:54:56 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-03-12 13:54:56 +0000
commit34703823f08443bd6a1e7d01d2f7cdf58cd1387b (patch)
treeabe41825b2924075e9a1215be1dfcfae30963a12 /roundcubemail/program/include/rcube_imap.php
parent40c69682392b7b0aece37bd3fb5826d981dc6c32 (diff)
- fixes for proper handling of email addresses with form: "user"@domain.tld
git-svn-id: https://svn.roundcube.net/trunk@3358 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include/rcube_imap.php')
-rw-r--r--roundcubemail/program/include/rcube_imap.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/roundcubemail/program/include/rcube_imap.php b/roundcubemail/program/include/rcube_imap.php
index cb8299607..91d36c2a3 100644
--- a/roundcubemail/program/include/rcube_imap.php
+++ b/roundcubemail/program/include/rcube_imap.php
@@ -2675,8 +2675,12 @@ class rcube_imap
foreach ($a as $val)
{
$j++;
- $address = $val['address'];
- $name = preg_replace(array('/^[\'"]/', '/[\'"]$/'), '', trim($val['name']));
+ $address = trim($val['address']);
+ $name = trim($val['name']);
+
+ if (preg_match('/^[\'"]/', $name) && preg_match('/[\'"]$/', $name))
+ $name = preg_replace(array('/^[\'"]/', '/[\'"]$/'), '', $name);
+
if ($name && $address && $name != $address)
$string = sprintf('%s <%s>', preg_match("/$special_chars/", $name) ? '"'.addcslashes($name, '"').'"' : $name, $address);
else if ($address)
@@ -2687,7 +2691,7 @@ class rcube_imap
$out[$j] = array('name' => $name,
'mailto' => $address,
'string' => $string);
-
+
if ($max && $j==$max)
break;
}