From 41f50613093daaafa4e2f130bd11266fa37049be Mon Sep 17 00:00:00 2001 From: aNiassy Date: Mon, 24 Oct 2011 09:49:57 +0000 Subject: [PATCH] [-] #PSCFI-3773 : Changed the treatment which validate the email and added a condition for receivers --- classes/Mail.php | 2 +- classes/Validate.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/Mail.php b/classes/Mail.php index a23422301..c840225ec 100644 --- a/classes/Mail.php +++ b/classes/Mail.php @@ -83,7 +83,7 @@ class MailCore } /* Construct multiple recipients list if needed */ - if (is_array($to)) + if (is_array($to) and isset($to)) { $to_list = new Swift_RecipientList(); foreach ($to AS $key => $addr) diff --git a/classes/Validate.php b/classes/Validate.php index 6c7bbcdca..85ece9cfa 100644 --- a/classes/Validate.php +++ b/classes/Validate.php @@ -45,7 +45,7 @@ class ValidateCore */ public static function isEmail($email) { - return empty($email) OR preg_match('/^[a-z0-9!#$%&\'*+\/=?^`{}|~_-]+[.a-z0-9!#$%&\'*+\/=?^`{}|~_-]*@[a-z0-9]+[._a-z0-9-]*\.[a-z0-9]+$/ui', $email); + return !empty($email) AND preg_match('/^[a-z0-9!#$%&\'*+\/=?^`{}|~_-]+[.a-z0-9!#$%&\'*+\/=?^`{}|~_-]*@[a-z0-9]+[._a-z0-9-]*\.[a-z0-9]+$/ui', $email); } /**