From 740b8ea74a122e7988504ea17222bc969fe55813 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Sat, 05 Jul 2014 07:41:21 -0400
Subject: [PATCH] Fix bug where contacts with no email address were listed on compose addressbook (#1489970)

---
 CHANGELOG                                |    1 +
 program/lib/Roundcube/rcube_contacts.php |    2 +-
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index 82c80fc..4a58d9e 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -55,6 +55,7 @@
 - Fix incorrect label translation in return receipt (#1489963)
 - Fix security issue in delete-response action - allow only ajax request
 - Fix Delete button state after deleting identity/response (#1489972)
+- Fix bug where contacts with no email address were listed on compose addressbook (#1489970)
 
 RELEASE 1.0.1
 -------------
diff --git a/program/lib/Roundcube/rcube_contacts.php b/program/lib/Roundcube/rcube_contacts.php
index d215760..5e1a40e 100644
--- a/program/lib/Roundcube/rcube_contacts.php
+++ b/program/lib/Roundcube/rcube_contacts.php
@@ -264,7 +264,7 @@
             if ($read_vcard)
                 $sql_arr = $this->convert_db_data($sql_arr);
             else {
-                $sql_arr['email'] = explode(self::SEPARATOR, $sql_arr['email']);
+                $sql_arr['email'] = $sql_arr['email'] ? explode(self::SEPARATOR, $sql_arr['email']) : array();
                 $sql_arr['email'] = array_map('trim', $sql_arr['email']);
             }
 

--
Gitblit v1.9.1