Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/Components/teams/TeamImageUploader.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ const TeamImageUploader = ({ profilePicFromApi, setToast, setIsLoading }) => {
const handleFileChange = (e) => {
const file = e.target.files[0];
if (file) {
// Block SVG files for security
const isSvg = file.type === "image/svg+xml" || (file.name && file.name.toLowerCase().endsWith(".svg"));
if (isSvg) {
setToast({ message: "SVG files are not allowed for security reasons.", type: "error" });
Comment thread
mdawoud27 marked this conversation as resolved.
e.target.value = '';
return;
}
setSelectedFile(file);
setPreviewImage(URL.createObjectURL(file));
}
Expand Down