enhanced logging for invalid tempid token

This commit is contained in:
Nathan Coad
2020-02-24 22:46:17 +11:00
parent f79f298978
commit cb29873efa

View File

@@ -14,6 +14,7 @@ function booking_balance_page() {
//verify that arg(1) is a uuid
if (! preg_match('/^[0-9A-Fa-f\-]+$/', arg(1))) {
//parameter from url is not what we were expecting
watchdog('booking', "Invalid token supplied to the balance payment page.");
drupal_set_message("Error: Invalid token supplied to the balance payment page. Please use the contact us form to let us know.", 'error', FALSE);
drupal_goto('<front>');
return "";
@@ -38,7 +39,7 @@ function booking_balance_page() {
$person = $query->execute()
->fetchObject();
*/
if ($person) {
//load all the fields
$node = node_load($person->nid);
@@ -47,6 +48,9 @@ function booking_balance_page() {
//maximum length for invoice id in paypal is 127 characters so truncate if necessary
$invoiceid = substr($invoiceid, 0, 126);
} else {
watchdog('booking', "<pre>Unmatched token supplied to the balance payment page:\n@info</pre>", array(
'@info' => print_r(arg(1), true)
));
drupal_set_message("Error: Invalid token supplied to the balance payment page. Please use the contact us form to let us know.", 'error', FALSE);
drupal_goto('<front>');
return "";