{:soso_e151:}我会告诉 360出蛊惑- function dreferer($$default = '') {
- global $$_G;
- $$default = empty($$default) ? $$GLOBALS['_t_curapp'] : '';
- $$_G['referer'] = !empty($$_GET['referer']) ? $$_GET['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'] = dhtmlspecialchars($$_G['referer'], ENT_QUOTES);
- $$_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($$reurl['host'], strpos($$reurl['host'], '.')+1);
- if(empty($$_G['setting']['domain']['root']) || (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']);
- }
复制代码 |