From 96dd127843e2d643d0cfcd74ee03d23d690a5aeb Mon Sep 17 00:00:00 2001 From: phl0 Date: Fri, 14 Jul 2023 08:02:25 +0200 Subject: [PATCH] Prevent search for empty call (resulting in SQL error messages) --- application/controllers/Visitor.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/application/controllers/Visitor.php b/application/controllers/Visitor.php index 1e5317e2..999d3cd6 100644 --- a/application/controllers/Visitor.php +++ b/application/controllers/Visitor.php @@ -470,10 +470,12 @@ class Visitor extends CI_Controller { $callsign = $this->security->xss_clean($this->input->post('callsign')); $public_slug = $this->security->xss_clean($this->input->post('public_slug')); $this->load->model('publicsearch'); - $result = $this->publicsearch->search($public_slug, $callsign); $data['page_title'] = "Public Search"; $data['callsign'] = $callsign; $data['slug'] = $public_slug; + if ($callsign != '') { + $result = $this->publicsearch->search($public_slug, $callsign); + } if (!empty($result) && $result->num_rows() > 0) { $data['results'] = $result; $this->load->view('visitor/layout/header', $data);