From f8e4112b4e0bf78e3e2e4a4c33f19b3cfd4605e3 Mon Sep 17 00:00:00 2001 From: Julio Cesar Laura Date: Thu, 20 Sep 2012 14:25:35 -0400 Subject: [PATCH] Add validation when the from is not a email or is not teh same email that the account --- workflow/engine/classes/class.wsBase.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/workflow/engine/classes/class.wsBase.php b/workflow/engine/classes/class.wsBase.php index e4b85478e..f66d60170 100755 --- a/workflow/engine/classes/class.wsBase.php +++ b/workflow/engine/classes/class.wsBase.php @@ -791,8 +791,8 @@ class wsBase $sBody = G::replaceDataField( $templateContents, $Fields); $hasEmailFrom = preg_match('/(.+)@(.+)\.(.+)/', $sFrom, $match); - if (!$hasEmailFrom) { - $sFrom = $aSetup['MESS_ACCOUNT']; + if (!$hasEmailFrom || strtolower($sFrom) != strtolower($aSetup['MESS_ACCOUNT'])) { + $sFrom = '"' . stripslashes($sFrom) . '" <' . $aSetup['MESS_ACCOUNT'] . ">"; } $messageArray = array(