diff --git a/htdocs/application/models/pastes.php b/htdocs/application/models/pastes.php index 2a9f68f..95e6f1f 100644 --- a/htdocs/application/models/pastes.php +++ b/htdocs/application/models/pastes.php @@ -455,10 +455,11 @@ class Pastes extends CI_Model $this->load->library('process'); $amount = $this->config->item('per_page'); $page = ($this->uri->segment($seg) ? $this->uri->segment($seg) : 0); - $search = '%' . $this->input->get('search') . '%'; + $search = $this->input->get('search'); if ($search) { + $search = '%' . $search . '%'; // count total results $sql = "SELECT id FROM pastes WHERE private = 0 AND (title LIKE ? OR raw LIKE ?)"; @@ -549,10 +550,11 @@ class Pastes extends CI_Model $this->load->library('pagination'); $amount = $this->config->item('per_page'); $page = ($this->uri->segment(2) ? $this->uri->segment(2) : 0); - $search = '%' . $this->input->get('search') . '%'; + $search = $this->input->get('search'); if ($search) { + $search = '%' . $search . '%'; // count total results $sql = "SELECT id FROM pastes WHERE private = 0 AND (title LIKE ? OR raw LIKE ?)";