1
0
mirror of https://github.com/ZeroCatDev/Classworks.git synced 2026-02-04 16:03:10 +00:00

restrict background protocols and document scaling

Co-authored-by: Sunwuyuan <88357633+Sunwuyuan@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2025-12-29 10:30:32 +00:00
parent 3d0c51dfa1
commit 85ab4d6c9f

View File

@ -2218,7 +2218,7 @@ export default {
try { try {
const parsed = new URL(trimmed, window.location.origin); const parsed = new URL(trimmed, window.location.origin);
const protocol = parsed.protocol.replace(":", ""); const protocol = parsed.protocol.replace(":", "");
if (!["http", "https", "blob"].includes(protocol)) return false; if (!["http", "https"].includes(protocol)) return false;
if (parsed.pathname.includes("..")) return false; if (parsed.pathname.includes("..")) return false;
return true; return true;
} catch (e) { } catch (e) {
@ -2238,10 +2238,7 @@ export default {
if (typeof CSS !== "undefined" && CSS.escape) { if (typeof CSS !== "undefined" && CSS.escape) {
return CSS.escape(value); return CSS.escape(value);
} }
return value return encodeURI(value);
.replace(/["'\\]/g, "\\$&")
.replace(/[\n\r\f]/g, "")
.replace(/[^a-zA-Z0-9_\-/:.@%?#=&]/g, (char) => `\\${char}`);
}, },
safeBase64Decode(base64String) { safeBase64Decode(base64String) {
@ -2454,6 +2451,6 @@ export default {
} }
.home-background { .home-background {
transform: scale(1.02); transform: scale(1.02); /* slight zoom to mask blur edges */
} }
</style> </style>