From 3b9681df0a3b9aaa64e84f1add306805e8aab0fe Mon Sep 17 00:00:00 2001 From: mroxso <24775431+mroxso@users.noreply.github.com> Date: Mon, 16 Dec 2024 21:49:24 +0100 Subject: [PATCH] Fix code scanning alert no. 1: DOM text reinterpreted as HTML (#21) Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- lumina/components/UploadComponent.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lumina/components/UploadComponent.tsx b/lumina/components/UploadComponent.tsx index fc741f0..107cca0 100644 --- a/lumina/components/UploadComponent.tsx +++ b/lumina/components/UploadComponent.tsx @@ -27,7 +27,9 @@ const UploadComponent: React.FC = () => { const file = event.target.files?.[0]; if (file) { const url = URL.createObjectURL(file); - setPreviewUrl(url); + if (url.startsWith('blob:')) { + setPreviewUrl(url); + } // Optional: Bereinigung alter URLs return () => URL.revokeObjectURL(url);