discuz php解读,Discuz common.inc.php 部分解释-不断更新

//设置禁止所有错误报告

error_reporting(0);

//禁止使用溢出字符转义

set_magic_quotes_runtime(0);

//获取时间

$mtime = explode(' ', microtime());

//构造创建时间

$discuz_starttime = $mtime[1] + $mtime[0];

//

define('SYS_DEBUG', FALSE);

define('IN_DISCUZ', TRUE);

define('DISCUZ_ROOT', substr(dirname(__FILE__), 0, -7));

define('MAGIC_QUOTES_GPC', get_magic_quotes_gpc());

//!defined('CURSCRIPT') && define('CURSCRIPT', '');

//如果php的版本少于4.1 进行赋值处理

if(PHP_VERSION < '4.1.0') {

$_GET = &$HTTP_GET_VARS;

$_POST = &$HTTP_POST_VARS;

$_COOKIE = &$HTTP_COOKIE_VARS;

$_SERVER = &$HTTP_SERVER_VARS;

$_ENV = &$HTTP_ENV_VARS;

$_FILES = &$HTTP_POST_FILES;

}

if (isset($_REQUEST['GLOBALS']) OR isset($_FILES['GLOBALS'])) {

exit('Request tainting attempted.');

}

//引入基础函数

require_once DISCUZ_ROOT.'./include/global.func.php';

//判断访问的是spider吗? 如果是,插入记录,IS_ROBOT = true

getrobot();

if(defined('NOROBOT') && IS_ROBOT) {

exit(header("HTTP/1.1 403 Forbidden"));

}

//动态获取所有参数数据

foreach(array('_COOKIE', '_POST', '_GET') as $_request) {

foreach($$_request as $_key => $_value) {

$_key{0} != '_' && $$_key = daddslashes($_value);

}

}

//将收录 的 File请求,如果是数组,将变成key-value数组

if (!MAGIC_QUOTES_GPC && $_FILES) {

$_FILES = daddslashes($_FILES);

}

//初始化$charset等参数为''

$charset = $dbs = $dbcharset = $forumfounders = $metakeywords = $extrahead = $seodescription = $mnid = '';

//初始化$plugins等参数为数组

$plugins = $admincp = $scriptlang = $forum = $thread = $language = $jsmenu = $actioncode = $modactioncode = $pluginclasses = $hooks = $lang = array();

$_DCOOKIE = $_DSESSION = $_DCACHE = $_DPLUGIN = $advlist = array();

//读取所有基本配置

require_once DISCUZ_ROOT.'./config.inc.php';

if($urlxssdefend && !empty($_SERVER['REQUEST_URI'])) {

// 解utf8码uri路径

$temp = urldecode($_SERVER['REQUEST_URI']);

if(strpos($temp, '

exit('Request Bad url');

}

//接收论坛的cookies_$_DCOOKIE数组处理

$prelength = strlen($cookiepre);

foreach($_COOKIE as $key => $val) {

if(substr($key, 0, $prelength) == $cookiepre) {

$_DCOOKIE[(substr($key, $prelength))] = MAGIC_QUOTES_GPC ? $val : daddslashes($val);

}

}

//清除以下 所有的变量   cookies别名的前序 , 请求 ,

unset($prelength, $_request, $_key, $_value);

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值