Sanitize HTML code
using DOMPurify v1.0.2 Fixes https://github.com/PrivateBin/PrivateBin/issues/183
This commit is contained in:
@@ -1761,8 +1761,9 @@ jQuery.PrivateBin = function($, sjcl, Base64, RawDeflate) {
|
||||
tables: true,
|
||||
tablesHeaderId: true
|
||||
});
|
||||
// let showdown convert the HTML and sanitize HTML *afterwards*!
|
||||
$plainText.html(
|
||||
converter.makeHtml(text)
|
||||
DOMPurify.sanitize(converter.makeHtml(text), {SAFE_FOR_JQUERY: true})
|
||||
);
|
||||
// add table classes from bootstrap css
|
||||
$plainText.find('table').addClass('table-condensed table-bordered');
|
||||
|
||||
2
js/purify.min.js
vendored
Normal file
2
js/purify.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user