|
123456789101112131415161718192021222324252627282930313233343536373839 |
- <?php
-
- require_once(dirname(__FILE__).'/../system/common.inc.php');
- require_once(DEDEINC."/libraries/oxwindow.class.php");
- $url = isset($url)? RemoveXSS($url) : '';
- if (preg_match("#^http#", $url)) {
- $rur = parse_url($url);
- $loc = parse_url($cfg_basehost);
- if (!$rur || !$loc) {
- ShowMsg("地址错误","javascript:;");
- exit;
- }
- if ($rur['host'] !== $loc['host']) {
-
- $wintitle = "将要访问";
- $msg = "<code>$url</code><div class='mt-3'><a href='$url' class='btn btn-success btn-sm'>继续访问</a></div>";
- $wecome_info = "页面跳转提示";
- $win = new OxWindow();
- $win->AddTitle("您将要访问的链接不属于当前站点,请关注您的账号安全。");
- $win->AddMsgItem($msg);
- $winform = $win->GetWindow("hand", false);
- $win->Display();
- } else {
- header('HTTP/1.1 301 Moved Permanently');
- header('Location:'.$url);
- }
- } else {
- ShowMsg("地址错误","javascript:;");
- exit;
- }
- ?>
|