more sanity checking

This commit is contained in:
Nathan Coad
2019-09-17 13:52:59 +10:00
parent e29e2d9f60
commit 884397a726

View File

@@ -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', "<pre>Autocomplete checking for ecclesia matching:\n@info</pre>", array('@info' => print_r($sanitised_string, true)));