From eae1bf0f3190ee3fffcdce0c0e0eae16e1b55e39 Mon Sep 17 00:00:00 2001 From: Nathan Coad Date: Tue, 21 Apr 2015 11:06:40 +1000 Subject: [PATCH] Strip whitespace from email address before validating --- booking.helper.inc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/booking.helper.inc b/booking.helper.inc index e6eec81..6b9fe6b 100644 --- a/booking.helper.inc +++ b/booking.helper.inc @@ -5,6 +5,10 @@ * Helper function to perform some validity checking of email addresses */ function _valid_email_address($email) { + + //strip any leading or trailing whitespace + $email = trim($email); + //firstly use the built-in function to validate the format if (! valid_email_address($email)) { watchdog('booking', "Drupal validation of email address '!email' returns false.", array('!email' => $email));