From 6eefec7f8c34c4ae71852477f4c7f765a30fbdef Mon Sep 17 00:00:00 2001 From: liyuchun Date: Tue, 19 Oct 2021 17:20:31 +0800 Subject: [PATCH] * Fix bug #15585. --- module/api/control.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/module/api/control.php b/module/api/control.php index 5b2da11eea..dec21547fe 100755 --- a/module/api/control.php +++ b/module/api/control.php @@ -156,7 +156,9 @@ class api extends control return $this->sendSuccess(array('locate' => $this->createLink('api', 'index', "libID=$libID"))); } - $this->view->title = $this->lang->api->publish . $lib->name; + $libName = isset($lib->name) ? $lib->name : ''; + $this->view->title = $this->lang->api->publish . $libName; + $this->display(); } @@ -600,15 +602,14 @@ class api extends control * @access public * @return void */ - private - function setMenu($libID = 0) + private function setMenu($libID = 0) { common::setMenuVars('doc', $libID); /* Global struct link. */ $menu = ''; - if(common::hasPriv('api', 'publish')) + if($libID and common::hasPriv('api', 'publish')) { $menu .= html::a(helper::createLink('api', 'publish', "libID=$libID"), $this->lang->api->publish, '', 'class="btn btn-link iframe"'); }