{
$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
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;