From 63c407058f9413c2728460bb911b1dce57d6e12c 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 a01b82f8f3..48d42da9fe 100644 --- a/CRM/Contact/Form/Task/EmailCommon.php +++ b/CRM/Contact/Form/Task/EmailCommon.php @@ -131,12 +131,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