From 00a74b3f79ffe2edc9d8063368a009d1fbc776e8 Mon Sep 17 00:00:00 2001 From: sunhao Date: Fri, 21 Feb 2025 09:59:55 +0800 Subject: [PATCH] * [misc] refactor doc-ajaxGetDoc with getDraft. --- module/doc/control.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/module/doc/control.php b/module/doc/control.php index 4b37b2624b..6de30856a8 100755 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -1869,6 +1869,7 @@ class doc extends control $doc->module = (int)$doc->module; $doc->privs = array('edit' => common::hasPriv('doc', 'edit', $doc)); $doc->editors = $this->doc->getEditors($docID); + $doc->draft = $this->doc->getDraft($docID); if($details == 'yes') { @@ -1889,12 +1890,11 @@ class doc extends control $doc->object = $object; } - if(!empty($doc->rawContent)) $doc->content = $doc->rawContent; - if($doc->contentType === 'doc' && is_string($doc->content)) $doc->content = htmlspecialchars_decode($doc->content); - if(is_string($doc->title)) $doc->title = htmlspecialchars_decode($doc->title); - if(!empty($doc->keywords) && is_string($doc->keywords)) $doc->keywords = htmlspecialchars_decode($doc->keywords); - - unset($doc->rawContent); + if(!empty($doc->rawContent)) + { + $doc->content = $doc->rawContent; + unset($doc->rawContent); + } if($docID) $this->doc->createAction($docID, 'view'); $this->send($doc);