Prevent search for empty call (resulting in SQL error messages)

This commit is contained in:
phl0 2023-07-14 08:02:25 +02:00
parent c3eca478e9
commit 96dd127843
No known key found for this signature in database
GPG Key ID: 48EA1E640798CA9A

View File

@ -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);