diff --git a/booking.helper.inc b/booking.helper.inc index 9a37c03..e6eec81 100644 --- a/booking.helper.inc +++ b/booking.helper.inc @@ -6,18 +6,23 @@ */ function _valid_email_address($email) { //firstly use the built-in function to validate the format - if (! valid_email_address($email)) + if (! valid_email_address($email)) { + watchdog('booking', "Drupal validation of email address '!email' returns false.", array('!email' => $email)); return false; + } //now check the domain exists if (preg_match('/^(.*?)\@(.*)/', $email, $matches)) { - //watchdog('booking', 'Email address checking: @info', array('@info' => var_export($matches, TRUE))); - if (! checkdnsrr($matches[2], "MX")) - return 0; - return 1; + //watchdog('booking', 'Email address checking: @info', array('@info' => var_export($matches, TRUE))); + if (! checkdnsrr($matches[2], "MX")) { + watchdog('booking', "No valid MX record found for email address '!email' with domain name !domain", array('!email' => $email, '!domain' => $matches[2])); + return false; + } + return true; } + watchdog('booking', "Regular expression failed to detect domain portion of email address '!email'", array('!email' => $email)); //watchdog('booking', 'Email address checking doesnt match'); - return 0; + return false; } /** diff --git a/booking.paypal.inc b/booking.paypal.inc index 8793df3..b3cfdcd 100644 --- a/booking.paypal.inc +++ b/booking.paypal.inc @@ -14,7 +14,7 @@ function _booking_paypal_post($data = array()) { function _booking_paypal_ipn_verify($vars = array()) { if (variable_get('booking_paypal_sandbox', 0)) { - watchdog('booking', 'Setting IPN verify to true, running in sandbox mode'); + watchdog('booking', 'Setting IPN verify to true, running in sandbox mode'); // PayPal sandbox requires login in order to even access, so for sandbox mode, simply return true. return TRUE; }