handle problems in email display and processing for further use after commit rev48461

This commit is contained in:
Klaus Leithoff 2014-09-05 12:20:49 +00:00
parent 8c9854daa2
commit dc472cdb11
2 changed files with 14 additions and 4 deletions

View File

@ -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

View File

@ -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;