Skip to content

Commit c1533f8

Browse files
Fix code scanning alert no. 6: DOM text reinterpreted as HTML (#1547)
Signed-off-by: Priyankar Pal <[email protected]> Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent 773ab0e commit c1533f8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/plays/personal-profile-card/components/profile-form.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React from 'react';
2+
import DOMPurify from 'dompurify';
23

34
import ProfileType from '../types';
45
import placeholder_cover from '../images/placeholder_cover.jpg';
@@ -27,7 +28,7 @@ const ProfileForm = ({ value, profile, onChange, onClick, onUpload, onClear }: P
2728
<img
2829
alt={value.cover === '' ? 'placeholder cover' : 'cover'}
2930
className="w-full md:w-[600px] h-[150px] sm:h-[200px] rounded-3xl"
30-
src={value.cover === '' ? placeholder_cover : value.cover}
31+
src={value.cover === '' ? placeholder_cover : DOMPurify.sanitize(value.cover)}
3132
/>
3233
<input
3334
accept="image/*"

0 commit comments

Comments
 (0)