//设置禁止所有错误报告
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, '<') !== false || strpos($temp, '"') !== false)
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);