125续15l-8:修innerHTML+onclick引号嵌套截断属性值(根因)

This commit is contained in:
ypsdf1
2026-11-20 10:29:09 +08:00
parent 8f55d72685
commit f90702dfc0
+4 -1
View File
@@ -604,7 +604,10 @@ require_once __DIR__ . '/captcha_guard.php';
applyAgreementUI(); applyAgreementUI();
document.getElementById('agreementSection').style.display = AG.need ? 'block' : 'none'; document.getElementById('agreementSection').style.display = AG.need ? 'block' : 'none';
actionsDiv.style.display = 'flex'; actionsDiv.style.display = 'flex';
actionsDiv.innerHTML = '<button class="btn btn-primary" style="width:100%" onclick="enterWeb(' + JSON.stringify(player) + ')">进入 Web 端</button>'; // ★ 125 续15l-8:player 用单引号包(HTML 属性值本身用双引号),
// 并对 player 做 HTML 转义防 XSS + 防引号嵌套截断属性值
const _p = JSON.stringify(player).replace(/"/g, "'");
actionsDiv.innerHTML = '<button class="btn btn-primary" style="width:100%" onclick="enterWeb(' + _p + ')">进入 Web 端</button>';
return; return;
} }
// ★ 已签 / 无协议 → 无感登录:直接跳转(fireAgreementMark 幂等,未签才补写;显式传 player) // ★ 已签 / 无协议 → 无感登录:直接跳转(fireAgreementMark 幂等,未签才补写;显式传 player)