From 4cd74bd08a2669ac2038ed336fc651a467f0735b Mon Sep 17 00:00:00 2001 From: guanxiying Date: Thu, 12 Dec 2019 14:49:02 +0800 Subject: [PATCH] * Fix comments and add default referer. --- module/doc/control.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/module/doc/control.php b/module/doc/control.php index 152704ea69..50cb0b9f90 100644 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -771,7 +771,7 @@ class doc extends control } /** - * Show libs for product or project + * Show accessDenied response. * * @access private * @return void @@ -780,10 +780,12 @@ class doc extends control { echo(js::alert($this->lang->doc->accessDenied)); - $loginLink = $this->config->requestType == 'GET' ? "?{$this->config->moduleVar}=user&{$this->config->methodVar}=login" : "user{$this->config->requestFix}login"; + if(!$this->server->http_referer) die(js::locate(inlink('index'))); - if(strpos($this->server->http_referer, $loginLink) !== false) die(js::locate(inlink('index'))); - die(js::locate('back')); + $loginLink = $this->config->requestType == 'GET' ? "?{$this->config->moduleVar}=user&{$this->config->methodVar}=login" : "user{$this->config->requestFix}login"; + if(strpos($this->server->http_referer, $loginLink) !== false) die(js::locate(inlink('index'))); + + die(js::locate('back')); } /**