This commit is contained in:
1 parent
339df89fcf
commit
651c36367f
33 files changed
+1420
-40
No files matched your search
@@ -4,12 +4,14 @@ function e(e) {
|
||||
typeof e != `string` ||
|
||||
!e.startsWith(`/`) ||
|
||||
e.startsWith(`//`) ||
|
||||
// eslint-disable-next-line no-control-regex -- 安全边界:拒绝跳转路径中的控制字符。
|
||||
/[\\\u0000-\u0020\u007f]/.test(e)
|
||||
)
|
||||
return `/`;
|
||||
try {
|
||||
// 路径解码后再次检查,避免编码后的双斜杠或反斜杠绕过站内限制。
|
||||
let t = decodeURIComponent(e.split(/[?#]/, 1)[0] || ``);
|
||||
// eslint-disable-next-line no-control-regex -- 安全边界:解码后仍须拒绝控制字符绕过。
|
||||
if (t.startsWith(`//`) || /[\\\u0000-\u0020\u007f]/.test(t)) return `/`;
|
||||
} catch {
|
||||
return `/`;
|
||||
|
||||
Reference in new issue
Block a user