Fix code scanning alert no. 89: DOM text reinterpreted as HTML
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
This commit is contained in:
parent
fc63841169
commit
91e5882814
@ -1,5 +1,7 @@
|
||||
'use client'
|
||||
|
||||
const MAX_FILE_SIZE = 5 * 1024 * 1024; // 5MB
|
||||
|
||||
import type { ChangeEvent, FC } from 'react'
|
||||
import { createRef, useEffect, useState } from 'react'
|
||||
import type { Area } from 'react-easy-crop'
|
||||
@ -38,9 +40,10 @@ const Uploader: FC<UploaderProps> = ({
|
||||
|
||||
const handleLocalFileInput = (e: ChangeEvent<HTMLInputElement>) => {
|
||||
const file = e.target.files?.[0]
|
||||
if (file)
|
||||
if (file && ALLOW_FILE_EXTENSIONS.includes(file.type.split('/').pop()?.toLowerCase() || '') && file.size <= MAX_FILE_SIZE) {
|
||||
setInputImage({ file, url: URL.createObjectURL(file) })
|
||||
}
|
||||
}
|
||||
|
||||
const {
|
||||
isDragActive,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user