* Code for bug #34060.

This commit is contained in:
caoyanyi
2023-04-12 11:23:05 +08:00
parent 493e4a8589
commit 1b9bbe097d
2 changed files with 5 additions and 4 deletions
+1 -2
View File
@@ -1142,12 +1142,11 @@ class doc extends control
public function view($docID = 0, $version = 0, $appendLib = 0)
{
$doc = $this->doc->getById($docID);
if(!$doc)
if(!$doc or !isset($doc->id))
{
if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'fail', 'code' => 404, 'message' => '404 Not found'));
return print(js::error($this->lang->notFound) . js::locate($this->inlink('index')));
}
if(!$this->doc->checkPrivDoc($doc)) return $this->accessDenied();
$lib = $this->doc->getLibById($doc->lib);
if(!empty($lib) and $lib->deleted == '1') $appendLib = $doc->id;