From: Steve Sutton Date: Mon, 11 Jun 2018 13:06:53 +0000 (-0400) Subject: Update calls to valid email check. X-Git-Tag: v1.6.87^2~1 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=fa2c796977e0938bb49d04bb264f7d922492e9f6;p=WP-Plugins%2Fglm-member-db-events.git 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. --- 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'] : '' );