mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-24 01:18:23 +00:00
[docs] sanitize html input for comments (#2677)
This commit is contained in:
parent
b721cd4150
commit
b55b260c89
1 changed files with 3 additions and 2 deletions
|
|
@ -9,6 +9,7 @@ import CommentFooter from '@/Editor/Comment/CommentFooter';
|
|||
import usePopover from '@/_hooks/use-popover';
|
||||
import { commentsService } from '@/_services';
|
||||
import useRouter from '@/_hooks/use-router';
|
||||
import DOMPurify from 'dompurify';
|
||||
|
||||
const Comment = ({
|
||||
socket,
|
||||
|
|
@ -78,7 +79,7 @@ const Comment = ({
|
|||
const handleSubmit = async (comment) => {
|
||||
await commentsService.createComment({
|
||||
threadId,
|
||||
comment,
|
||||
comment: DOMPurify.sanitize(comment),
|
||||
appVersionsId,
|
||||
});
|
||||
socket.send(
|
||||
|
|
@ -97,7 +98,7 @@ const Comment = ({
|
|||
};
|
||||
|
||||
const handleEdit = async (comment, cid) => {
|
||||
await commentsService.updateComment(cid, { comment });
|
||||
await commentsService.updateComment(cid, { comment: DOMPurify.sanitize(comment) });
|
||||
fetchData();
|
||||
socket.send(
|
||||
JSON.stringify({
|
||||
|
|
|
|||
Loading…
Reference in a new issue