From e1239fe866fee823f6cab147c63f836f87ef5ac0 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Mon, 1 Aug 2016 21:30:30 +1000 Subject: [PATCH] Fix up cleaning out array of from emails and avoid execption as found by Jitendra --- CRM/Contact/Form/Task/EmailCommon.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/CRM/Contact/Form/Task/EmailCommon.php b/CRM/Contact/Form/Task/EmailCommon.php index e52e3bfc9b..be19562a85 100644 --- a/CRM/Contact/Form/Task/EmailCommon.php +++ b/CRM/Contact/Form/Task/EmailCommon.php @@ -129,12 +129,8 @@ class CRM_Contact_Form_Task_EmailCommon { $form->_emails[$domainEmail] = $domainEmail; } $form->_fromEmails = CRM_Utils_Array::crmArrayMerge($emails, $domainEmails); - foreach ($form->_fromEmails as $key => $fromEmail) { - if (empty($fromEmail)) { - unset($form->_fromEmails[$key]); - } - } - if (!empty($emails)) { + $form->_fromEmails = array_filter($form->_fromEmails); + if (is_numeric(key($form->_fromEmails))) { // Add signature $defaultEmail = civicrm_api3('email', 'getsingle', array('id' => key($form->_fromEmails))); $defaults = array(); -- 2.25.1