From 7e4b3e97fd3b8663121b78223640c3e4d7fa4eca Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Sun, 22 Feb 2009 12:53:45 -0700 Subject: [PATCH] expandAddresses() doesn't return a PEAR_Error --- imp/lib/Compose.php | 4 +++- imp/lib/UI/Compose.php | 13 ------------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/imp/lib/Compose.php b/imp/lib/Compose.php index 67e20ed66..190a29a45 100644 --- a/imp/lib/Compose.php +++ b/imp/lib/Compose.php @@ -2500,9 +2500,11 @@ class IMP_Compose { $sparams = IMP_Compose::getAddressSearchParams(); $res = $GLOBALS['registry']->call('contacts/search', array($search, $sparams['sources'], $sparams['fields'], true)); - if (is_a($res, 'PEAR_Error') || !count($res)) { + if (is_a($res, 'PEAR_Error')) { Horde::logMessage($res, __FILE__, __LINE__, PEAR_LOG_ERR); return array(); + } elseif (!count($res)) { + return array(); } /* The first key of the result will be the search term. The matching diff --git a/imp/lib/UI/Compose.php b/imp/lib/UI/Compose.php index 67d264cd7..b1f83fe6e 100644 --- a/imp/lib/UI/Compose.php +++ b/imp/lib/UI/Compose.php @@ -21,19 +21,6 @@ class IMP_UI_Compose if (is_array($result)) { $GLOBALS['notification']->push(_("Please resolve ambiguous or invalid addresses."), 'horde.warning'); - } elseif (is_a($result, 'PEAR_Error')) { - $error = $result; - $result = array(); - - $list = $error->getUserInfo(); - if (is_array($list)) { - foreach ($list as $entry) { - $result[] = is_object($entry) - ? $entry->getUserInfo() - : $entry; - } - } - $GLOBALS['notification']->push($error, 'horde.warning'); } return $result; -- 2.11.0