Skip to content

Commit

Permalink
[FIXED] xss issue
Browse files Browse the repository at this point in the history
  • Loading branch information
w8tcha committed Jul 11, 2023
1 parent e726a2e commit a4b154b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ckeditor-wordcount-plugin",
"version": "1.17.11",
"version": "1.17.12",
"author": "w8tcha",
"description": "WordCount Plugin for CKEditor Editor",
"repository": {
Expand Down
6 changes: 1 addition & 5 deletions wordcount/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
CKEDITOR.plugins.add("wordcount",
{
lang: "ar,bg,ca,cs,da,de,el,en,es,eu,fa,fi,fr,he,hr,hu,it,ka,ko,ja,nl,no,pl,pt,pt-br,ru,sk,sv,tr,uk,zh-cn,zh,ro", // %REMOVE_LINE_CORE%
version: "1.17.11",
version: "1.17.12",
requires: "htmlwriter,notification,undo",
bbcodePluginLoaded: false,
onLoad: function() {
Expand Down Expand Up @@ -175,13 +175,9 @@ CKEDITOR.plugins.add("wordcount",
return html.replace(/\[.*?\]/gi, "");
}

var tmp = document.createElement("div");

// Add filter before strip
html = filter(html);

tmp.innerHTML = html;

// Parse filtered HTML, without applying it to any element in DOM
var tmp = new DOMParser().parseFromString(html, 'text/html');
if (!tmp.body || !tmp.body.textContent) {
Expand Down

0 comments on commit a4b154b

Please sign in to comment.