expandAddresses() doesn't return a PEAR_Error
authorMichael M Slusarz <slusarz@curecanti.org>
Sun, 22 Feb 2009 19:53:45 +0000 (12:53 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Mon, 23 Feb 2009 02:48:12 +0000 (19:48 -0700)
imp/lib/Compose.php
imp/lib/UI/Compose.php

index 67e20ed..190a29a 100644 (file)
@@ -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
index 67d264c..b1f83fe 100644 (file)
@@ -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;