From bbec693cab1148df6363486cd22d7388914fc397 Mon Sep 17 00:00:00 2001 From: rugk Date: Tue, 21 Nov 2017 22:26:02 +0100 Subject: [PATCH] Allow DOMPurify as a global --- .eslintrc | 1 + js/privatebin.js | 1 + tpl/bootstrap.php | 2 +- tpl/page.php | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.eslintrc b/.eslintrc index e2a42cc7..cee9820d 100644 --- a/.eslintrc +++ b/.eslintrc @@ -11,6 +11,7 @@ env: globals: sjcl: false + DOMPurify: false # http://eslint.org/docs/rules/ rules: diff --git a/js/privatebin.js b/js/privatebin.js index ddc1372e..0d34603a 100644 --- a/js/privatebin.js +++ b/js/privatebin.js @@ -1763,6 +1763,7 @@ jQuery.PrivateBin = function($, sjcl, Base64, RawDeflate) { }); // let showdown convert the HTML and sanitize HTML *afterwards*! $plainText.html( + /** global: DOMPurify */ DOMPurify.sanitize(converter.makeHtml(text), {SAFE_FOR_JQUERY: true}) ); // add table classes from bootstrap css diff --git a/tpl/bootstrap.php b/tpl/bootstrap.php index e75614e9..def90dfb 100644 --- a/tpl/bootstrap.php +++ b/tpl/bootstrap.php @@ -70,7 +70,7 @@ if ($MARKDOWN): - + diff --git a/tpl/page.php b/tpl/page.php index 6d636d0e..9c1db28d 100644 --- a/tpl/page.php +++ b/tpl/page.php @@ -48,7 +48,7 @@ if ($MARKDOWN): - +