Skip to content

Commit 5053663

Browse files
protect against script tags
1 parent 0893e63 commit 5053663

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

js/render-datatables.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,10 +269,10 @@
269269
default:
270270
render = $.fn.dataTable.render.extra = function ( data, type, row ) {
271271
if((data === true || data === 'true') && typeof series.format !== 'undefined' && series.format.truthy !== ''){
272-
data = series.format.truthy;
272+
data = series.format.truthy.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, '');
273273
}
274274
if((data === false || data === 'false') && typeof series.format !== 'undefined' && series.format.falsy !== ''){
275-
data = series.format.falsy;
275+
data = series.format.falsy.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, '');
276276
}
277277
return data;
278278
}

0 commit comments

Comments
 (0)