Fix #577 - Fix empty addr variable creating logs

This commit is contained in:
y.yerli 2025-01-14 18:13:00 +03:00
parent a2ff98643a
commit bb4afd4b56

View file

@ -872,10 +872,7 @@ class SugarEmailAddress extends SugarBean
$optOut = ''
) {
if (!is_array($new_addrs)) {
$GLOBALS['log']->fatal(
'Invalid Argument: new address should be an array of strings, ' .
gettype($new_addrs) . ' given.'
);
$new_addrs = array($new_addrs);
}
$module = $this->getCorrectedModule($module);
//One last check for the ConvertLead action in which case we need to change $module to 'Leads'
@ -1083,6 +1080,11 @@ class SugarEmailAddress extends SugarBean
$optIn = null
) {
$addr = html_entity_decode($addr, ENT_QUOTES);
if (empty($addr)) {
return;
}
if (preg_match($this->regex, $addr)) {
$primaryFlag = ($primary) ? '1' : '0';
$replyToFlag = ($replyTo) ? '1' : '0';