properly escaping HTML in raw text mode, fixes #358

This commit is contained in:
El RIDO 2018-09-02 09:14:36 +02:00
parent fe7fa09ce8
commit 8b71cb0b2f
No known key found for this signature in database
GPG key ID: 0F5C940A6BD81F92
3 changed files with 3 additions and 3 deletions

View file

@ -2894,7 +2894,7 @@ jQuery.PrivateBin = (function($, sjcl, Base64, RawDeflate) {
for (var i = 0; i < $head.length; i++) {
newDoc.write($head[i].outerHTML);
}
newDoc.write('</head><body><pre>' + DOMPurify.sanitize(paste) + '</pre></body></html>');
newDoc.write('</head><body><pre>' + DOMPurify.sanitize($('<div />').text(paste).html()) + '</pre></body></html>');
newDoc.close();
}