From 0dcf45a152d584831a419fa4f31412f05f76b585 Mon Sep 17 00:00:00 2001 From: joyqi Date: Sat, 30 Oct 2021 00:02:41 +0800 Subject: [PATCH] fix #1220 --- var/Widget/Contents/Page/Edit.php | 2 +- var/Widget/Contents/Post/Edit.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/var/Widget/Contents/Page/Edit.php b/var/Widget/Contents/Page/Edit.php index 58f27420..396c02c6 100644 --- a/var/Widget/Contents/Page/Edit.php +++ b/var/Widget/Contents/Page/Edit.php @@ -47,7 +47,7 @@ class Edit extends PostEdit implements ActionInterface $this->user->pass('editor'); /** 获取文章内容 */ - if (!empty($this->request->cid) && 'delete' != $this->request->do && 'sort' != $this->request->do) { + if (!empty($this->request->cid) && in_array($this->request->do, ['save', 'publish'])) { $this->db->fetchRow($this->select() ->where('table.contents.type = ? OR table.contents.type = ?', 'page', 'page_draft') ->where('table.contents.cid = ?', $this->request->filter('int')->cid) diff --git a/var/Widget/Contents/Post/Edit.php b/var/Widget/Contents/Post/Edit.php index 0131aae6..463745c0 100644 --- a/var/Widget/Contents/Post/Edit.php +++ b/var/Widget/Contents/Post/Edit.php @@ -45,7 +45,7 @@ class Edit extends Contents implements ActionInterface $this->user->pass('contributor'); /** 获取文章内容 */ - if (!empty($this->request->cid) && 'delete' != $this->request->do) { + if (!empty($this->request->cid) && in_array($this->request->do, ['save', 'publish'])) { $this->db->fetchRow($this->select() ->where('table.contents.type = ? OR table.contents.type = ?', 'post', 'post_draft') ->where('table.contents.cid = ?', $this->request->filter('int')->cid)