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>
This commit is contained in:
mroxso
2024-12-16 21:49:24 +01:00
committed by GitHub
parent c8e74c7789
commit 3b9681df0a

View File

@@ -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);