From 884397a72687577e18ebbd583278b8a06fd8c6f8 Mon Sep 17 00:00:00 2001 From: Nathan Coad Date: Tue, 17 Sep 2019 13:52:59 +1000 Subject: [PATCH] more sanity checking --- booking.regn_form.inc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/booking.regn_form.inc b/booking.regn_form.inc index 9d7dd19..c6a4a19 100644 --- a/booking.regn_form.inc +++ b/booking.regn_form.inc @@ -70,6 +70,13 @@ function booking_register_page() */ function _booking_ecclesia_name_autocomplete($string = "") { $matches = array(); + + if ($string === "") { + // Return empty result to the form in json + drupal_json_output($matches); + return; + } + $sanitised_string = preg_replace("/[^a-zA-Z0-9\s\.']/", '', $string); $sanitised_string .= "%"; //watchdog('booking_debug', "
Autocomplete checking for ecclesia matching:\n@info
", array('@info' => print_r($sanitised_string, true)));