* [misc] refactor doc-ajaxGetDoc with getDraft.

This commit is contained in:
sunhao
2025-02-21 11:22:06 +08:00
committed by 刘刚
parent dd69de48bd
commit 00a74b3f79
+6 -6
View File
@@ -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);