找回密码
 注册账号

QQ登录

只需一步,快速开始

《泰拉瑞亚下载-1.4.2.3版》 泰拉瑞亚服务器 - MOD模组下载

入驻泰拉战网 新手指引 - 升级 - 师徒

泰拉瑞亚合成表 泰拉卡牌 - 泰拉江湖 - 泰拉刺客

联系泰拉开发组👈进入 积分市场 - 房产交易 - 水晶获取

查看: 2541|回复: 0

Discuz dreferer 刷新重定向

[复制链接]

431

主题

77

回帖

8

广播

论坛版主

积分
214
泰拉
0
水晶
10
铜钥匙
0
银钥匙
0
金钥匙
0

【江湖新秀】【宝剑回鞘】【泰拉达人】【奥运选手】

发表于 2020-10-29 22:47:36 | 显示全部楼层 |阅读模式

  1. /**
  2. * 刷新重定向
  3. */

  4. function dreferer($default = '') {
  5.         global $_G;

  6.         $default = empty($default) && $_ENV['curapp'] ? $_ENV['curapp'].'.php' : '';
  7.         $_G['referer'] = !empty($_GET['referer']) ? $_GET['referer'] : $_SERVER['HTTP_REFERER'];
  8.         $_G['referer'] = substr($_G['referer'], -1) == '?' ? substr($_G['referer'], 0, -1) : $_G['referer'];

  9.         if(strpos($_G['referer'], 'member.php?mod=logging')) {
  10.                 $_G['referer'] = $default;
  11.         }

  12.         $reurl = parse_url($_G['referer']);

  13.         if(!$reurl || (isset($reurl['scheme']) && !in_array(strtolower($reurl['scheme']), array('http', 'https')))) {
  14.                 $_G['referer'] = '';
  15.         }

  16.         list($http_host,)=explode(':', $_SERVER['HTTP_HOST']);

  17.         if(!empty($reurl['host']) && !in_array($reurl['host'], array($http_host, 'www.'.$http_host)) && !in_array($http_host, array($reurl['host'], 'www.'.$reurl['host']))) {
  18.                 if(!in_array($reurl['host'], $_G['setting']['domain']['app']) && !isset($_G['setting']['domain']['list'][$reurl['host']])) {
  19.                         $domainroot = substr($reurl['host'], strpos($reurl['host'], '.')+1);
  20.                         if(empty($_G['setting']['domain']['root']) || (is_array($_G['setting']['domain']['root']) && !in_array($domainroot, $_G['setting']['domain']['root']))) {
  21.                                 $_G['referer'] = $_G['setting']['domain']['defaultindex'] ? $_G['setting']['domain']['defaultindex'] : 'index.php';
  22.                         }
  23.                 }
  24.         } elseif(empty($reurl['host'])) {
  25.                 $_G['referer'] = $_G['siteurl'].'./'.$_G['referer'];
  26.         }

  27.         $_G['referer'] = durlencode($_G['referer']);
  28.         return $_G['referer'];
  29. }

复制代码

获得 大天使卡 一张

卡片说明:mickeyort 遇到 [非酋妖妖灵] 被赠与 1 金钥匙.

卡片效果:获得 1 金钥匙

您需要登录后才可以回帖 登录 | 注册账号

本版积分规则

QQ|友链申请|Archiver|手机版|小黑屋|游芯沙盒 ( 陕ICP备11006283号-1 )

GMT+8, 2024-5-2 23:37 , Processed in 0.192263 second(s), 41 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表