From ddafe4e4109a8d6d412c3c138412ee2ca3d58dbf Mon Sep 17 00:00:00 2001
From: Thomas Bruederli <thomas@roundcube.net>
Date: Sat, 27 Oct 2012 10:12:37 -0400
Subject: [PATCH] Merge branch 'dev-compose-newwindow'
---
program/include/rcube_addressbook.php | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/program/include/rcube_addressbook.php b/program/include/rcube_addressbook.php
index fb2027b..892ae26 100644
--- a/program/include/rcube_addressbook.php
+++ b/program/include/rcube_addressbook.php
@@ -422,7 +422,7 @@
function get_col_values($col, $data, $flat = false)
{
$out = array();
- foreach ($data as $c => $values) {
+ foreach ((array)$data as $c => $values) {
if ($c === $col || strpos($c, $col.':') === 0) {
if ($flat) {
$out = array_merge($out, (array)$values);
@@ -432,6 +432,11 @@
$out[$type] = array_merge((array)$out[$type], (array)$values);
}
}
+ }
+
+ // remove duplicates
+ if ($flat && !empty($out)) {
+ $out = array_unique($out);
}
return $out;
@@ -448,7 +453,7 @@
*/
protected static function normalize_string($str)
{
- return rcbe_utils::normalize_string($str);
+ return rcube_utils::normalize_string($str);
}
/**
@@ -465,7 +470,7 @@
$fn = $contact['name'];
if (!$fn) // default display name composition according to vcard standard
- $fn = join(' ', array_filter(array($contact['prefix'], $contact['firstname'], $contact['middlename'], $contact['surname'], $contact['suffix'])));
+ $fn = trim(join(' ', array_filter(array($contact['prefix'], $contact['firstname'], $contact['middlename'], $contact['surname'], $contact['suffix']))));
// use email address part for name
$email = is_array($contact['email']) ? $contact['email'][0] : $contact['email'];
--
Gitblit v1.9.1