summaryrefslogtreecommitdiff
path: root/program/include/rcube_imap.inc
diff options
context:
space:
mode:
Diffstat (limited to 'program/include/rcube_imap.inc')
-rw-r--r--program/include/rcube_imap.inc9
1 files changed, 7 insertions, 2 deletions
diff --git a/program/include/rcube_imap.inc b/program/include/rcube_imap.inc
index 3463ae21b..871b6c1f4 100644
--- a/program/include/rcube_imap.inc
+++ b/program/include/rcube_imap.inc
@@ -2117,7 +2117,12 @@ class rcube_imap
$j++;
$address = $val['address'];
$name = preg_replace(array('/^[\'"]/', '/[\'"]$/'), '', trim($val['name']));
- $string = $name!==$address ? sprintf('%s <%s>', strpos($name, ',')!==FALSE ? '"'.$name.'"' : $name, $address) : $address;
+ if ($name && $address && $name != $address)
+ $string = sprintf('%s <%s>', strpos($name, ',')!==FALSE ? '"'.$name.'"' : $name, $address);
+ else if ($address)
+ $string = $address;
+ else if ($name)
+ $string = $name;
$out[$j] = array('name' => $name,
'mailto' => $address,
@@ -2476,7 +2481,7 @@ class rcube_imap
foreach ($sub_a as $k => $v)
{
- if ((strpos($v, '@') > 0) && (strpos($v, '.') > 0))
+ if (strpos($v, '@') > 0)
$result[$key]['address'] = str_replace('<', '', str_replace('>', '', $v));
else
$result[$key]['name'] .= (empty($result[$key]['name'])?'':' ').str_replace("\"",'',stripslashes($v));