本帖最后由 hycampuse 于 2011-9-13 10:59 编辑
evenzhou 发表于 2011-9-13 10:26
检查 function_core.php中
dreferer函数是否与下面代码相同
不一样,我从官网上下的X2的代码是这样的
function dreferer($default = '') {
global $_G;$default = empty($default) ? $GLOBALS['_t_curapp'] : '';
$_G['referer'] = !empty($_G['gp_referer']) ? $_G['gp_referer'] : $_SERVER['HTTP_REFERER'];
$_G['referer'] = substr($_G['referer'], -1) == '?' ? substr($_G['referer'], 0, -1) : $_G['referer']; if(strpos($_G['referer'], 'member.php?mod=logging')) {
$_G['referer'] = $default;
}
$_G['referer'] = htmlspecialchars($_G['referer']);
$_G['referer'] = str_replace('&', '&', $_G['referer']);
$reurl = parse_url($_G['referer']);
if(!empty($reurl['host']) && !in_array($reurl['host'], array($_SERVER['HTTP_HOST'], 'www.'.$_SERVER['HTTP_HOST'])) && !in_array($_SERVER['HTTP_HOST'], array($reurl['host'], 'www.'.$reurl['host']))) {
if(!in_array($reurl['host'], $_G['setting']['domain']['app']) && !isset($_G['setting']['domain']['list'][$reurl['host']])) {
$domainroot = substr($_SERVER['HTTP_HOST'], strpos($_SERVER['HTTP_HOST'], '.')+1);
if(is_array($_G['setting']['domain']['root']) && !in_array($domainroot, $_G['setting']['domain']['root'])) {
$_G['referer'] = $_G['setting']['domain']['defaultindex'] ? $_G['setting']['domain']['defaultindex'] : 'index.php';
}
}
} elseif(empty($reurl['host'])) {
$_G['referer'] = $_G['siteurl'].'./'.$_G['referer'];
}
return strip_tags($_G['referer']);
}
|