From 594cea2f8cd68d5dfd9154b1352a79f839b07f6c Mon Sep 17 00:00:00 2001 From: pengjiangxiu Date: Fri, 21 Jul 2017 11:27:26 +0800 Subject: [PATCH] * Fix bug #1112. --- module/action/control.php | 11 ++++++++++- module/action/lang/en.php | 1 + module/action/lang/zh-cn.php | 1 + module/action/lang/zh-tw.php | 1 + 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/module/action/control.php b/module/action/control.php index 389d0cda44..4bfd85b965 100755 --- a/module/action/control.php +++ b/module/action/control.php @@ -113,7 +113,16 @@ class action extends control */ public function editComment($actionID) { - if(trim(strip_tags($this->post->lastComment, ''))) $this->action->updateComment($actionID); + if(trim(strip_tags($this->post->lastComment, ''))) + { + $this->action->updateComment($actionID); + } + else + { + dao::$errors['submit'][] = $this->lang->action->historyEdit; + $this->send(array('result' => 'fail', 'message' => dao::getError())); + } + die(js::locate($this->server->http_referer, 'parent')); } } diff --git a/module/action/lang/en.php b/module/action/lang/en.php index 600905ed53..a5aa9f1920 100755 --- a/module/action/lang/en.php +++ b/module/action/lang/en.php @@ -31,6 +31,7 @@ $lang->action->textDiff = 'Text Format'; $lang->action->original = 'Original Format'; $lang->action->confirmHideAll = 'Do you want to hide all the records?'; $lang->action->needEdit = '%s you want to restore has already existed. Please edit it.'; +$lang->action->historyEdit = 'The history editor cannot be empty.'; $lang->action->dynamic = new stdclass(); $lang->action->dynamic->today = 'Today'; diff --git a/module/action/lang/zh-cn.php b/module/action/lang/zh-cn.php index f9f560a409..1f2b80f298 100755 --- a/module/action/lang/zh-cn.php +++ b/module/action/lang/zh-cn.php @@ -31,6 +31,7 @@ $lang->action->textDiff = '文本格式'; $lang->action->original = '原始格式'; $lang->action->confirmHideAll = '您确定要全部隐藏这些记录吗?'; $lang->action->needEdit = '要还原%s的名称或代号已经存在,请编辑更改。'; +$lang->action->historyEdit = '历史记录编辑不能为空。'; $lang->action->dynamic = new stdclass(); $lang->action->dynamic->today = '今天'; diff --git a/module/action/lang/zh-tw.php b/module/action/lang/zh-tw.php index fb5d68fb15..4ae7a62869 100755 --- a/module/action/lang/zh-tw.php +++ b/module/action/lang/zh-tw.php @@ -31,6 +31,7 @@ $lang->action->textDiff = '文本格式'; $lang->action->original = '原始格式'; $lang->action->confirmHideAll = '您確定要全部隱藏這些記錄嗎?'; $lang->action->needEdit = '要還原%s的名稱或代號已經存在,請編輯更改。'; +$lang->action->historyEdit = '歷史記錄編輯不能為空。'; $lang->action->dynamic = new stdclass(); $lang->action->dynamic->today = '今天';