This commit is contained in:
liyuchun
2022-04-28 09:02:44 +00:00
parent 11af6b43a2
commit 83fa4afc83
5 changed files with 24 additions and 2 deletions
+12
View File
@@ -93,6 +93,18 @@ class install extends control
$this->view->sessionInfo = $sessionInfo;
}
$notice = '';
if($this->config->framework->filterCSRF)
{
$httpType = (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == 'on') ? 'https' : 'http';
if(isset($_SERVER['HTTP_X_FORWARDED_PROTO']) and strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'https') $httpType = 'https';
if(isset($_SERVER['REQUEST_SCHEME']) and strtolower($_SERVER['REQUEST_SCHEME']) == 'https') $httpType = 'https';
$httpHost = zget($_SERVER, 'HTTP_HOST', '');
if(empty($httpHost) or strpos($this->server->http_referer, "$httpType://$httpHost") !== 0) $notice = $this->lang->install->CSRFNotice;
}
$this->view->notice = $notice;
$this->display();
}