mirror of
https://github.com/lumina-rocks/lumina.git
synced 2026-06-05 10:11:16 +02:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user