详情
评论
问答

子比主题美化-GO跳转页v2.0版本

可添加白名单,不是白名单链接显示未知,链接超出盒子长度自动显示省略号

教程开始

自行更换go.php中的图片地址

/wp-content/uploads/replace/f6c3a0171a84a5bac81647b1c2d6c353.png

将下面源码替换zibll文件夹中的go.php文件即可

<?php
/*
 * @Author        : Denver
 * @Project       : GO跳转页
 */
if (
    strlen($_SERVER['REQUEST_URI']) > 384 ||
    strpos($_SERVER['REQUEST_URI'], "||") !== false ||
    strpos($_SERVER['REQUEST_URI'], "base64") !== false
) {
    @header("HTTP/1.1 414 Request-URI Too Long");
    @header("Status: 414 Request-URI Too Long");
    @header("Connection: Close");
    @exit;
}

// 通过QUERY_STRING取得完整的传入数据,然后取得url=之后的所有值,兼容性更好
@session_start();
$t_url = !empty($_SESSION['GOLINK']) ? $_SESSION['GOLINK'] : preg_replace('/^url=(.*)$/i', '$1', $_SERVER["QUERY_STRING"]);

// 数据处理
if (!empty($t_url)) {
    // 判断取值是否加密
    if ($t_url == base64_encode(base64_decode($t_url))) {
        $t_url = base64_decode($t_url);
    }
    // 防止xss
    $t_url = htmlspecialchars($t_url);
    // 对取值进行网址校验和判断
    preg_match('/^(http|https|thunder|qqdl|ed2k|Flashget|qbrowser):\\/\\//i', $t_url, $matches);
    $wiiui_title = get_bloginfo('name');
    $title = $wiiui_title . ' - 安全中心';
    if ($matches) {
        $url = $t_url;
    } else {
        preg_match('/\\./i', $t_url, $matche);
        if ($matche) {
            $url = 'http://' . $t_url;
        } else {
            $url = 'http://' . $_SERVER['HTTP_HOST'];
            $title = '参数错误,正在返回首页...';
        }
    }
} else {
    $title = '参数缺失,正在返回首页...';
    $url = 'http://' . $_SERVER['HTTP_HOST'];
}
$url = str_replace('&', '&', $url);
?>

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title><?php echo $title; ?></title>
    </script>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        body {
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            background-image: url(/wp-content/uploads/replace/f6c3a0171a84a5bac81647b1c2d6c353.png);
            background-size: cover;
            background-position: center;
            background-repeat: no-repeat;
        }
        .container {
            background-color: rgba(255, 255, 255, 0.9);
            border-radius: 8px;
            padding: 20px;
            width: 300px;
            text-align: center;
        }
        .logo {
            width: 260px;
            height: 80px;
            margin-bottom: 20px;
        }
        .status {
            font-size: 14px;
            color: #777;
            margin-top: 5px;
        }
        .buttons {
            margin-top: 20px;
        }
        .button {
            color: white;
            border: none;
            padding: 10px 20px;
            border-radius: 4px;
            cursor: pointer;
            margin: 5px;
            text-decoration: none;
        }
        .jb-pink{
            background:linear-gradient(135deg, #ff5e7f 30%, #ff967e 100%);
        }
        .jb-cyan{
            background:linear-gradient(140deg, #039ab3 10%, #58dbcf 90%);
        }
.moxing_link {
    width: 95%;
    background-color: #e0e0e0;
    padding: 10px;
    border-radius: 25px;
    font-weight: bold;
    display: flex; /* 修改为flex布局 */
    align-items: center; /* 垂直居中对齐 */
    justify-content: flex-start; /* 水平起始对齐 */
}

.moxing_link .text {
    white-space: nowrap; /* 防止文本换行 */
    overflow: hidden; /* 隐藏超出部分 */
    text-overflow: ellipsis; /* 使用省略号表示超出的文本 */
    max-width: 100%; /* 设置最大宽度为100% */
}
                #icon-container {
            display: inline-block;
            vertical-align: middle;
            margin-right: 5px;
           
        }
    </style>
</head>
<body>
    <div class="tuc-2ea177b2-f1e668-0 container tuc-2ea177b2-f1e668-0">
        <img src="https://cdn.nuoyo.cn/zy-file/2023/08/20230803085532780.png" alt="Logo" class="tuc-2ea177b2-f1e668-0 logo tuc-2ea177b2-f1e668-0">
        <p class="tuc-2ea177b2-f1e668-0 moxing_link tuc-2ea177b2-f1e668-0">
            <span id="icon-container"></span>
            <span class="tuc-2ea177b2-f1e668-0 text tuc-2ea177b2-f1e668-0"><?php echo $url; ?></span>
        </p>
        <p id="link-status" class="tuc-2ea177b2-f1e668-0 status tuc-2ea177b2-f1e668-0"></p>
        <div class="tuc-2ea177b2-f1e668-0 buttons tuc-2ea177b2-f1e668-0">
            <button onclick="location.replace('<?php echo $url; ?>')" class="tuc-2ea177b2-f1e668-0 button jb-pink tuc-2ea177b2-f1e668-0" id="continue-button">继续前往</button>
            <button onclick="setTimeout(function() { location.replace('//<?php echo $_SERVER['HTTP_HOST']; ?>'); }, 1000)" class="tuc-2ea177b2-f1e668-0 button jb-cyan tuc-2ea177b2-f1e668-0" id="home-button">回到主页</button>
        </div>
    </div>

    <script>
        // 初始化白名单数组
        const whitelist = [
            "zibll.com",
            "moxingbk.com",
            "baidu.com",
            "qq.com",
            "weixin.com"
        ];

        // 获取链接并检测是否在白名单内
        const linkStatus = document.getElementById('link-status');
        const continueButton = document.getElementById('continue-button');
const iconContainer = document.getElementById('icon-container');
        const targetLink = '<?php echo $url; ?>';
        const parsedLink = new URL(targetLink);

        function isSubdomainSafe(url) {
            const hostname = parsedLink.hostname;
            const domainParts = hostname.split('.');
            const topLevelDomain = domainParts.slice(-2).join('.');
            return whitelist.includes(topLevelDomain);
        }

        if (isSubdomainSafe(targetLink)) {
            linkStatus.textContent = '该链接安全,请点击继续前往';
            continueButton.style.display = 'inline-block';
            iconContainer.innerHTML = '<svg t="1732432429874" class="tuc-2ea177b2-f1e668-0 icon tuc-2ea177b2-f1e668-0" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2886" width="30" height="30"><path d="M651.636 325.818a139.636 139.636 0 1 0-279.272 0v93.091h279.272v-93.09z m69.819 93.091A93.09 93.09 0 0 1 814.545 512v279.273a93.09 93.09 0 0 1-93.09 93.09h-418.91a93.09 93.09 0 0 1-93.09-93.09V512a93.09 93.09 0 0 1 93.09-93.09h23.273v-93.092a186.182 186.182 0 1 1 372.364 0v93.091h23.273zM768 791.273V512a46.545 46.545 0 0 0-46.545-46.545h-418.91A46.545 46.545 0 0 0 256 512v279.273a46.545 46.545 0 0 0 46.545 46.545h418.91A46.545 46.545 0 0 0 768 791.273z" fill="#21A3DD" p-id="2887"></path><path d="M488.727 645.353v76.102a23.273 23.273 0 0 0 46.546 0v-76.102a46.545 46.545 0 1 0-46.546 0z" fill="#21A3DD" p-id="2888"></path></svg>';
        } else {
            linkStatus.textContent = '该链接安全性未知,请保护好个人信息';
            continueButton.style.display = 'inline-block';
            iconContainer.innerHTML = '<svg t="1732433495577" class="tuc-2ea177b2-f1e668-0 icon tuc-2ea177b2-f1e668-0" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6123" width="20" height="20"><path d="M512 93.090909a232.727273 232.727273 0 0 1 232.727273 232.727273h93.090909A325.818182 325.818182 0 0 0 186.181818 325.818182v93.090909H93.090909v605.090909h837.818182V418.909091H279.272727V325.818182a232.727273 232.727273 0 0 1 232.727273-232.727273z m325.818182 837.818182H186.181818v-418.909091h651.636364z" fill="#757575" p-id="6124"></path><path d="M465.454545 651.636364h93.09091v139.636363H465.454545z" fill="#757575" p-id="6125"></path></svg>';        
            }
    </script>
</body>
</html>

子比主题美化-GO跳转页v2.0版本插图

文章很赞,支持一下吧~ 还没有人为TA充电
为TA充电
还没有人为TA充电
© 版权声明
THE END
喜欢就支持一下吧
点赞13打赏 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容