From 68dabd75e22efa589736d4f2acf8bfbaeb734636 Mon Sep 17 00:00:00 2001 From: vicus <servicecesk@vicus.nl> Date: Thu, 28 Apr 2022 12:51:30 +0200 Subject: [PATCH] fix #1647 V7.4 Mail Manager Action Menu Missing Sometimes --- vtlib/Vtiger/Functions.php | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/vtlib/Vtiger/Functions.php b/vtlib/Vtiger/Functions.php index bc9899c21..abc252407 100644 --- a/vtlib/Vtiger/Functions.php +++ b/vtlib/Vtiger/Functions.php @@ -1550,7 +1550,7 @@ class Vtiger_Functions { switch ($type) { case 'id' : $ok = (preg_match('/[^0-9xH]/', $value)) ? false : $ok; break; - case 'email' : $ok = (!filter_var($value, FILTER_VALIDATE_EMAIL)) ? false : $ok; + case 'email' : $ok = self::validateTypeEmail($value); break; case 'idlist' : $ok = (preg_match('/[a-zA-Z]/', $value)) ? false : $ok; break; @@ -1567,6 +1567,16 @@ class Vtiger_Functions { return $ok; } + public static function validateTypeEmail(string $value):bool { + $ok = TRUE; + $mailaddresses = explode(',', $value); + + foreach($mailaddresses as $mailaddress){ + if(!filter_var($mailaddress, FILTER_VALIDATE_EMAIL)) $ok = FALSE; + } + return $ok; + } + /** * Function to get file public url to access outside of CRM (from emails) * @param <Integer> $fileId @@ -1582,12 +1592,12 @@ class Vtiger_Functions { } return $publicUrl; } - + /** * Function to get the attachmentsid to given crmid * @param type $crmid * @param type $webaservice entity id - * @return <Array> + * @return <Array> */ static function getAttachmentIds($crmid, $WsEntityId) { $adb = PearDatabase::getInstance(); @@ -1604,7 +1614,7 @@ class Vtiger_Functions { } return $attachmentIds; } - + static function generateTrackingURL($params = []){ $options = array( 'handler_path' => 'modules/Emails/handlers/Tracker.php', -- GitLab