summaryrefslogtreecommitdiff
path: root/program/include
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2011-05-13 17:51:28 +0000
committerthomascube <thomas@roundcube.net>2011-05-13 17:51:28 +0000
commit445a4ca04dfcd255f9d89ee76757b04c2d87bbfc (patch)
tree5c856d680807fac621ca4472b0c0d85e80888048 /program/include
parent8e99ffbcaccf83602a47b2be230eb4dd2f106399 (diff)
Fix empty name in search results and error when creating a new contact
Diffstat (limited to 'program/include')
-rw-r--r--program/include/rcube_contacts.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/program/include/rcube_contacts.php b/program/include/rcube_contacts.php
index 8abc76302..e7c078f7e 100644
--- a/program/include/rcube_contacts.php
+++ b/program/include/rcube_contacts.php
@@ -200,10 +200,13 @@ class rcube_contacts extends rcube_addressbook
$sql_arr = $this->convert_db_data($sql_arr);
else
$sql_arr['email'] = preg_split('/,\s*/', $sql_arr['email']);
-
+
// make sure we have a name to display
- if (empty($sql_arr['name']))
+ if (empty($sql_arr['name'])) {
+ if (empty($sql_arr['email']))
+ $sql_arr['email'] = $this->get_col_values('email', $sql_arr, true);
$sql_arr['name'] = $sql_arr['email'][0];
+ }
$this->result->add($sql_arr);
}