From 120dfbd2695344dea2fac1de5f9c438aa0314de6 Mon Sep 17 00:00:00 2001 From: Bubbo <85169821+xbubbo@users.noreply.github.com> Date: Thu, 21 Nov 2024 21:25:59 -0500 Subject: [PATCH] Fix code scanning alert no. 4: DOM text reinterpreted as HTML Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- src/lib/global.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/global.ts b/src/lib/global.ts index 63243b3..695e42c 100644 --- a/src/lib/global.ts +++ b/src/lib/global.ts @@ -94,6 +94,7 @@ document.addEventListener("astro:page-load", () => { let PanicLink = localStorage.getItem("link") || ""; try { PanicLink = new URL(PanicLink).toString(); + PanicLink = DOMPurify.sanitize(PanicLink); } catch (e) { PanicLink = ""; }