From f2a4a50c7cfb1d380982591b115b09486749ec0c Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Mon, 16 Nov 2009 13:58:42 -0700 Subject: [PATCH] Don't attempt to expand an empty address field --- imp/lib/UI/Compose.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/imp/lib/UI/Compose.php b/imp/lib/UI/Compose.php index 0efbbe556..d19ca6984 100644 --- a/imp/lib/UI/Compose.php +++ b/imp/lib/UI/Compose.php @@ -17,13 +17,18 @@ class IMP_UI_Compose */ public function expandAddresses($input, $imp_compose) { - $result = $imp_compose->expandAddresses($this->getAddressList($input)); + $addr_list = $this->getAddressList($input); + if (empty($addr_list)) { + return ''; + } + + $res = $imp_compose->expandAddresses($addr_list); - if (is_array($result)) { + if (is_array($res)) { $GLOBALS['notification']->push(_("Please resolve ambiguous or invalid addresses."), 'horde.warning'); } - return $result; + return $res; } /** @@ -129,7 +134,7 @@ class IMP_UI_Compose /** */ public function getAddressList($to, $to_list = array(), $to_field = array(), - $to_new = '', $expand = false) + $to_new = '', $expand = false) { $to = rtrim(trim($to), ','); if (!empty($to)) { -- 2.11.0