From fa2c796977e0938bb49d04bb264f7d922492e9f6 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Mon, 11 Jun 2018 09:06:53 -0400 Subject: [PATCH] Update calls to valid email check. Trim the email first. This prevents it from failing if there's a space in start or end of the email that is being checked. --- classes/helper/notification.php | 2 +- models/front/events/frontAdd.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/helper/notification.php b/classes/helper/notification.php index 54e7032..7cec4fc 100644 --- a/classes/helper/notification.php +++ b/classes/helper/notification.php @@ -161,7 +161,7 @@ class GlmMembersAdmin_event_notification extends GlmDataMembers // Double check the email for valid address $emails = explode( ',', $notify_to ); foreach ( $emails as $email ) { - $validEmail = filter_var( $email, FILTER_VALIDATE_EMAIL ); + $validEmail = filter_var( trim( $email ), FILTER_VALIDATE_EMAIL ); if ( !$validEmail ) { return false; } diff --git a/models/front/events/frontAdd.php b/models/front/events/frontAdd.php index 43a5614..6ec1500 100644 --- a/models/front/events/frontAdd.php +++ b/models/front/events/frontAdd.php @@ -262,7 +262,7 @@ class GLmMembersFront_events_frontAdd extends GlmDataEvents } // get the sender's email address and validate it - $fromEmail = trim(filter_var($emailInfo['from_email'], FILTER_VALIDATE_EMAIL)); + $fromEmail = filter_var( trim( $emailInfo['from_email'] ), FILTER_VALIDATE_EMAIL ); // get the email notification message $emailNotification = ( isset($emailInfo['email_notification']) ? $emailInfo['email_notification'] : '' ); -- 2.17.1