Options always shown below the group no matter how the list is sorted
XSS protection for tables and trees
This commit is contained in:
parent
e230510b72
commit
d9211377dd
6 changed files with 96 additions and 21 deletions
|
@ -239,8 +239,21 @@ class Table extends Component {
|
|||
type: 'html',
|
||||
createdCell: createdCellFn
|
||||
});
|
||||
}
|
||||
|
||||
// FIXME, sift all columns through renderToStaticMarkup in order to sanitize the HTML
|
||||
// XSS protection
|
||||
for (const column of columns) {
|
||||
const originalRender = column.render;
|
||||
column.render = (data, ...rest) => {
|
||||
if (originalRender) {
|
||||
const markup = originalRender(data, ...rest);
|
||||
return ReactDOMServer.renderToStaticMarkup(<div>{markup}</div>);
|
||||
} else {
|
||||
return ReactDOMServer.renderToStaticMarkup(<div>{data}</div>)
|
||||
}
|
||||
};
|
||||
|
||||
column.title = ReactDOMServer.renderToStaticMarkup(<div>{column.title}</div>);
|
||||
}
|
||||
|
||||
const dtOptions = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue