Update calls to valid email check.
authorSteve Sutton <steve@gaslightmedia.com>
Mon, 11 Jun 2018 13:06:53 +0000 (09:06 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Mon, 11 Jun 2018 13:06:53 +0000 (09:06 -0400)
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
models/front/events/frontAdd.php

index 54e7032..7cec4fc 100644 (file)
@@ -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;
             }
index 43a5614..6ec1500 100644 (file)
@@ -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'] : '' );