diff --git a/application/third_party/recommend/controllers/index.php b/application/third_party/recommend/controllers/index.php index 27c0e89b..a3d28d1d 100644 --- a/application/third_party/recommend/controllers/index.php +++ b/application/third_party/recommend/controllers/index.php @@ -35,7 +35,7 @@ class Index extends CI_Controller $data = array(); $data['groupList'] = $this->Information_model->group_list(); $data['tipsList'] = $this->infoTips_model->search($keywords, $byWhat); - $data['keywords'] = $keywords; + $data['lastKeyword'] = $keywords; $this->load->view('bootstrap3/header', $data); $this->load->view('welcome'); $this->load->view('bootstrap3/footer'); diff --git a/application/third_party/recommend/models/infoTips_model.php b/application/third_party/recommend/models/infoTips_model.php index f441475e..41660253 100644 --- a/application/third_party/recommend/models/infoTips_model.php +++ b/application/third_party/recommend/models/infoTips_model.php @@ -60,11 +60,11 @@ class infoTips_model extends CI_Model $whereCodition = ''; if ($byWhat == 'byTitle') { - $whereCodition .= " and it.it_title like '%" . addslashes($keywords) . "%'"; + $whereCodition .= " and it.it_title like '%" . $this->HT->escape_str($keywords) . "%'"; } else if ($byWhat == 'byLabel') { - $whereCodition .= " and it.it_code like '%" . addslashes($keywords) . "%'"; + $whereCodition .= " and it.it_code like '%" . $this->HT->escape_str($keywords) . "%'"; } else if ($byWhat == 'byContent') { - $whereCodition .= " and it.it_content like '%" . addslashes($keywords) . "%'"; + $whereCodition .= " and it.it_content like '%" . $this->HT->escape_str($keywords) . "%'"; } $searchText = "select it.it_id ,it.it_title,it.it_expires,it.it_code,it.it_content,it.it_sitecode,it.it_datetime diff --git a/application/third_party/recommend/views/welcome.php b/application/third_party/recommend/views/welcome.php index b976e3f1..93dc3642 100644 --- a/application/third_party/recommend/views/welcome.php +++ b/application/third_party/recommend/views/welcome.php @@ -8,7 +8,7 @@