国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.3KB

  1. <?php
  2. /**
  3. * 地址跳转
  4. *
  5. * @version $id:jump.php$
  6. * @package DedeBIZ.Site
  7. * @copyright Copyright (c) 2022 DedeBIZ.COM
  8. * @license https://www.dedebiz.com/license
  9. * @link https://www.dedebiz.com
  10. */
  11. require_once(dirname(__FILE__).'/../system/common.inc.php');
  12. require_once(DEDEINC."/libraries/oxwindow.class.php");
  13. $url = isset($url)? RemoveXSS($url) : '';
  14. if (preg_match("#^http#", $url)) {
  15. $rur = parse_url($url);
  16. $loc = parse_url($cfg_basehost);
  17. if (!$rur || !$loc) {
  18. ShowMsg("地址错误","javascript:;");
  19. exit;
  20. }
  21. if ($rur['host'] !== $loc['host']) {
  22. //如果不是本站点的,则需要点击进行跳转
  23. $wintitle = "将要访问";
  24. $msg = "<code>$url</code><div class='mt-3'><a href='$url' class='btn btn-success btn-sm'>继续访问</a></div>";
  25. $wecome_info = "页面跳转提示";
  26. $win = new OxWindow();
  27. $win->AddTitle("您将要访问的链接不属于当前站点,请关注您的账号安全。");
  28. $win->AddMsgItem($msg);
  29. $winform = $win->GetWindow("hand", false);
  30. $win->Display();
  31. } else {
  32. header('HTTP/1.1 301 Moved Permanently');
  33. header('Location:'.$url);
  34. }
  35. } else {
  36. ShowMsg("地址错误","javascript:;");
  37. exit;
  38. }
  39. ?>