From: pdontthink Date: Thu, 19 Feb 2009 23:34:11 +0000 (+0000) Subject: Allow multiple addresses in one abook entry (separate with commas), although we HIGHL... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=1aecba700bd67f03dbddadc67fc8f8326d69abd7;p=squirrelmail.git Allow multiple addresses in one abook entry (separate with commas), although we HIGHLY DISCOURAGE grouping in this manner - note amongst other issues that can come up, sizing for large groups will be a problem git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@13407 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/functions/addressbook.php b/functions/addressbook.php index 905e630a..d260258a 100644 --- a/functions/addressbook.php +++ b/functions/addressbook.php @@ -516,12 +516,26 @@ class AddressBook { function full_address($row) { global $data_dir, $username; $addrsrch_fullname = getPref($data_dir, $username, 'addrsrch_fullname'); - if ($addrsrch_fullname == 'fullname') - return '"' . $row['name'] . '" <' . trim($row['email']) . '>'; - else if ($addrsrch_fullname == 'nickname') - return '"' . $row['nickname'] . '" <' . trim($row['email']) . '>'; - else // "noprefix" - return trim($row['email']); + + // allow multiple addresses in one row (poor person's grouping - bah) + // (separate with commas) + // + $return = ''; + $addresses = explode(',', $row['email']); + foreach ($addresses as $address) { + + if (!empty($return)) $return .= ', '; + + if ($addrsrch_fullname == 'fullname') + $return .= '"' . $row['name'] . '" <' . trim($address) . '>'; + else if ($addrsrch_fullname == 'nickname') + $return .= '"' . $row['nickname'] . '" <' . trim($address) . '>'; + else // "noprefix" + $return .= trim($address); + + } + + return $return; } /**