* code for task #6510.

This commit is contained in:
wangyidong
2019-11-19 11:13:17 +08:00
parent 3fd71d9708
commit 7244bcda02
2 changed files with 7 additions and 3 deletions
+1
View File
@@ -13,6 +13,7 @@
/* Framework settings. */
$config->framework->autoRepairTable = true;
$config->framework->autoLang = false;
$config->framework->filterCSRF = false;
/* Upload settings. */
$config->allowedTags = '<p><span><h1><h2><h3><h4><h5><em><u><strong><br><ol><ul><li><img><a><b><font><hr><pre><div><table><td><th><tr><tbody><embed><style>';
+6 -3
View File
@@ -595,9 +595,12 @@ class baseRouter
unset($_REQUEST);
/* Change for CSRF. */
$httpType = (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == 'on') ? 'https' : 'http';
$httpHost = $_SERVER['HTTP_HOST'];
if((!defined('RUN_MODE') or RUN_MODE != 'api') and strpos($this->server->http_referer, "$httpType://$httpHost") !== 0) $_FILES = $_POST = array();
if($this->config->framework->filterCSRF)
{
$httpType = (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == 'on') ? 'https' : 'http';
$httpHost = $_SERVER['HTTP_HOST'];
if((!defined('RUN_MODE') or RUN_MODE != 'api') and strpos($this->server->http_referer, "$httpType://$httpHost") !== 0) $_FILES = $_POST = array();
}
$_FILES = validater::filterFiles();
$_POST = validater::filterSuper($_POST);