From: Michael M Slusarz Date: Mon, 16 Nov 2009 20:58:42 +0000 (-0700) Subject: Don't attempt to expand an empty address field X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=f2a4a50c7cfb1d380982591b115b09486749ec0c;p=horde.git Don't attempt to expand an empty address field --- 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)) {