From c25b3e12cab320d7066b7d1a14e74ab442ff3c88 Mon Sep 17 00:00:00 2001 From: gongfuxiang <2499232802@qq.com> Date: Fri, 21 Jun 2019 00:11:36 +0800 Subject: [PATCH] =?UTF-8?q?=E9=97=AE=E7=AD=94=E6=95=B0=E6=8D=AE=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/service/AnswerService.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/application/service/AnswerService.php b/application/service/AnswerService.php index ed2704b55..9d9b67e12 100755 --- a/application/service/AnswerService.php +++ b/application/service/AnswerService.php @@ -228,11 +228,11 @@ class AnswerService // 开始操作 $data = [ 'user_id' => isset($params['user']['id']) ? intval($params['user']['id']) : (isset($params['user_id']) ? intval($params['user_id']) : 0), - 'name' => isset($params['name']) ? $params['name'] : '', - 'tel' => isset($params['tel']) ? $params['tel'] : '', - 'title' => isset($params['title']) ? $params['title'] : '', - 'content' => $params['content'], - 'reply' => isset($params['reply']) ? $params['reply'] : '', + 'name' => isset($params['name']) ? str_replace(['"', "'"], '', strip_tags($params['name'])) : '', + 'tel' => isset($params['tel']) ? str_replace(['"', "'"], '', strip_tags($params['tel'])) : '', + 'title' => isset($params['title']) ? str_replace(['"', "'"], '', strip_tags($params['title'])) : '', + 'content' => str_replace(['"', "'"], '', strip_tags($params['content'])), + 'reply' => isset($params['reply']) ? str_replace(['"', "'"], '', strip_tags($params['reply'])) : '', 'access_count' => isset($params['access_count']) ? intval($params['access_count']) : 0, 'is_reply' => isset($params['is_reply']) ? intval($params['is_reply']) : 0, 'is_show' => isset($params['is_show']) ? intval($params['is_show']) : 0,