Skip to content
Permalink
Browse files Browse the repository at this point in the history
[#2052] Sanitize string content in renderContent
  • Loading branch information
julianguyen committed Nov 19, 2021
1 parent 52df4c7 commit 83fd44e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion client/app/utils/index.js
@@ -1,6 +1,7 @@
// @flow
import axios from 'axios';
import renderHTML from 'react-render-html';
import { sanitize } from 'dompurify';

const randomString = () => Math.random()
.toString(36)
Expand Down Expand Up @@ -34,7 +35,7 @@ const getPusher = () => {

const renderContent = (content: string | any) => {
if (typeof content === 'string') {
return renderHTML(content);
return renderHTML(sanitize(content));
}
return content;
};
Expand Down

0 comments on commit 83fd44e

Please sign in to comment.