From 4c89480a8e75d03909c342a45612f6614849ac90 Mon Sep 17 00:00:00 2001 From: Anyon Date: Sun, 8 Apr 2018 11:05:32 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=9B=B4=E6=96=B0]=E5=85=A8=E9=83=A8=E5=8E=BB?= =?UTF-8?q?=E9=99=A4htmlspecialchars=E8=BE=93=E5=85=A5=E8=BF=87=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/wechat/controller/Keys.php | 1 - application/wechat/controller/News.php | 3 +-- application/wechat/controller/Review.php | 1 - 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/application/wechat/controller/Keys.php b/application/wechat/controller/Keys.php index d2d67a0fe..d4f1d71e3 100644 --- a/application/wechat/controller/Keys.php +++ b/application/wechat/controller/Keys.php @@ -180,7 +180,6 @@ class Keys extends BasicAdmin if ($this->request->isPost() && isset($data['keys'])) { $db = Db::name($this->table)->where('keys', $data['keys']); !empty($data['id']) && $db->where('id', 'neq', $data['id']); - $data['content'] = htmlspecialchars_decode($data['content']); $db->count() > 0 && $this->error('关键字已经存在,请使用其它关键字!'); } } diff --git a/application/wechat/controller/News.php b/application/wechat/controller/News.php index 48766ad3e..a34397874 100644 --- a/application/wechat/controller/News.php +++ b/application/wechat/controller/News.php @@ -172,7 +172,6 @@ class News extends BasicAdmin foreach ($data as &$vo) { $vo['create_by'] = session('user.id'); $vo['create_at'] = date('Y-m-d H:i:s'); - $vo['content'] = htmlspecialchars_decode($vo['content']); if (empty($vo['digest'])) { $vo['digest'] = mb_substr(strip_tags(str_replace(["\s", ' '], '', $vo['content'])), 0, 120); } @@ -280,7 +279,7 @@ class News extends BasicAdmin $article['content'] = preg_replace_callback("//i", function ($matches) { $src = MediaService::uploadImage($matches[2]); return ""; - }, htmlspecialchars_decode($article['content'])); + }, $article['content']); } $wechat = WechatService::media(); // 如果已经上传过,先删除之前的历史记录 diff --git a/application/wechat/controller/Review.php b/application/wechat/controller/Review.php index c656e4021..f84c20024 100644 --- a/application/wechat/controller/Review.php +++ b/application/wechat/controller/Review.php @@ -48,7 +48,6 @@ class Review extends Controller if (!empty($article['content_source_url'])) { $this->redirect($article['content_source_url']); } - $article['content'] = htmlspecialchars_decode($article['content']); $this->assign('vo', $article); } $this->assign('type', $type);