summaryrefslogtreecommitdiff
path: root/program/include/rcube_imap.php
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2009-01-16 19:32:58 +0000
committeralecpl <alec@alec.pl>2009-01-16 19:32:58 +0000
commitc58c0aedbaab765406de262f792b0998da151812 (patch)
treede845e8c73146ab29b35552b3113342b1ab30c93 /program/include/rcube_imap.php
parent9c5bee69d7e30bf9b019d63627a3395a10af1229 (diff)
- Fix address names with '@' sign handling (#1485654)
Diffstat (limited to 'program/include/rcube_imap.php')
-rw-r--r--program/include/rcube_imap.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/program/include/rcube_imap.php b/program/include/rcube_imap.php
index 36a346300..9fae0c672 100644
--- a/program/include/rcube_imap.php
+++ b/program/include/rcube_imap.php
@@ -2933,7 +2933,7 @@ class rcube_imap
// remove any newlines and carriage returns before
$a = $this->_explode_quoted_string('[,;]', preg_replace( "/[\r\n]/", " ", $str));
$result = array();
-
+
foreach ($a as $key => $val)
{
$val = preg_replace("/([\"\w])</", "$1 <", $val);
@@ -2942,8 +2942,8 @@ class rcube_imap
foreach ($sub_a as $k => $v)
{
- if (strpos($v, '@') > 0)
- $result[$key]['address'] = str_replace('<', '', str_replace('>', '', $v));
+ if (preg_match('/^<\S+@\S+>$/', $v))
+ $result[$key]['address'] = trim($v, '<>');
else
$result[$key]['name'] .= (empty($result[$key]['name'])?'':' ').str_replace("\"",'',stripslashes($v));
}