handle string parsing on own imap_rfc822_parse_adrlist ; improve on expectations, when string contains multiple rfc-addresses

This commit is contained in:
Klaus Leithoff 2014-09-09 11:41:51 +00:00
parent 40de690ae4
commit ea8fb452b8

View File

@ -102,7 +102,7 @@ if (!function_exists('imap_rfc822_parse_adrlist'))
foreach(explode(',', $address) as $part) foreach(explode(',', $address) as $part)
{ {
$trimmed = trim(($pending ? $pending.',' : '').$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; $pending .= ($pending ? $pending.',' : '').$part;
continue; continue;