From dc472cdb11081433f36651b43d4ebd10a8fbeee2 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Fri, 5 Sep 2014 12:20:49 +0000 Subject: [PATCH] handle problems in email display and processing for further use after commit rev48461 --- mail/js/app.js | 16 +++++++++++++--- phpgwapi/inc/common_functions.inc.php | 2 +- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/mail/js/app.js b/mail/js/app.js index 5695d7c4ea..12e0e77f42 100644 --- a/mail/js/app.js +++ b/mail/js/app.js @@ -663,11 +663,21 @@ app.classes.mail = AppJS.extend( content = content[0].split(','); } // Add for current record + var remembervalue = ''; for(var i = 0; i < content.length; i++) { - var value = content[i]; - var email = et2_createWidget('url-email',{id:widget.id+'_'+i, value:value,readonly:true, contact_plus:true},widget); - email.loadingFinished(); + // if there is no @ in string, its most likely that we have a comma in the personal name part of the emailaddress + if (content[i].indexOf('@')<0) + { + remembervalue = content[i]; + } + else + { + var value = remembervalue+(remembervalue?',':'')+content[i]; + var email = et2_createWidget('url-email',{id:widget.id+'_'+i, value:value,readonly:true, contact_plus:true},widget); + email.loadingFinished(); + remembervalue = ''; + } } } else diff --git a/phpgwapi/inc/common_functions.inc.php b/phpgwapi/inc/common_functions.inc.php index 4a78dd2efd..d129f793a9 100755 --- a/phpgwapi/inc/common_functions.inc.php +++ b/phpgwapi/inc/common_functions.inc.php @@ -102,7 +102,7 @@ if (!function_exists('imap_rfc822_parse_adrlist')) foreach(explode(',', $address) as $part) { $trimmed = trim(($pending ? $pending.',' : '').$part); - if ($trimmed[0] == '"' && substr($trimmed, -1) != '>') + if (($trimmed[0] == '"' && substr($trimmed, -1) != '>')||strpos($part, '@')===false) { $pending .= ($pending ? $pending.',' : '').$part; continue;