Skip to content

Commit 03f51d6

Browse files
committed
bug in vulnview javascript
1 parent f9d34bd commit 03f51d6

File tree

6 files changed

+16
-15
lines changed

6 files changed

+16
-15
lines changed

WebContent/dist/js/overview.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

WebContent/dist/js/templates.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

WebContent/dist/js/vulnview.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

WebContent/src/assessment/vulnview.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,6 @@ class VulnerabilityView {
196196
this._token = $("#_token")[0].value;
197197
this.queue = new SaveQueue(this, assessmentId, this.saveChanges, (type, vulns) => { this.updateCallback(type, vulns) });
198198
this.vulnId = -1;
199-
this.editors = {};
200199
this.descUndoCount = 0;
201200
this.initialHTML = {};
202201
this.assesssmentId = assessmentId //$("#assessmentId")[0].value;
@@ -233,12 +232,12 @@ class VulnerabilityView {
233232
$('[id^="rtCust"]').each(function () {
234233
const id = $(this).attr('id')
235234
if(id.indexOf("_header") == -1){
236-
_this.editors.createEditor(id,true);
235+
_this.editors.createEditor(id,true, ()=>{});
237236
}
238237
});
239-
_this.editors.createEditor("description",true);
240-
_this.editors.createEditor("recommendation",true);
241-
_this.editors.createEditor("details",true);
238+
_this.editors.createEditor("description",true, ()=>{});
239+
_this.editors.createEditor("recommendation",true, ()=>{});
240+
_this.editors.createEditor("details",true, ()=>{});
242241

243242
const initialHTML = entityDecode($("#notes").html());
244243
this.editors.createEditor("notes",true, (param, editor) =>{
@@ -1087,7 +1086,6 @@ class VulnerabilityView {
10871086
_this.queue.push('vulnerability', _this.vulnId, this.id, encodeURIComponent(b64EncodeUnicode(val)));
10881087
}));
10891088

1090-
10911089
$('[id^="rtCust"]').each(function () {
10921090
const rtId = this.id;
10931091
if(rtId.indexOf("header") == -1 ){

WebContent/src/utils/editor.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import tableMergedCell from '@toast-ui/editor-plugin-table-merged-cell'
55
import '@toast-ui/editor/dist/toastui-editor.css';
66
import 'tui-color-picker/dist/tui-color-picker.css';
77
import '@toast-ui/editor-plugin-color-syntax/dist/toastui-editor-plugin-color-syntax.css';
8+
import '@toast-ui/editor-plugin-table-merged-cell/dist/toastui-editor-plugin-table-merged-cell.css'
89
import { marked } from 'marked';
910
import TurndownService from 'turndown'
1011
let html2md = new TurndownService()
@@ -27,7 +28,7 @@ export class FactionEditor {
2728
'span', 'hr', 's', 'del', 'blockquote'
2829
// Add other tags Toast UI uses
2930
],
30-
ALLOWED_ATTR: ['href', 'src', 'alt', 'class', 'style', 'text-decoration'], // Optional
31+
ALLOWED_ATTR: ['href', 'src', 'alt', 'class', 'style', 'text-decoration', 'colspan'], // Optional
3132
});
3233
};
3334
createUnderlineButton(id) {
@@ -301,9 +302,12 @@ export class FactionEditor {
301302
}
302303

303304
recreateEditor(id, contents, offloadImages, isEncoded, callback){
305+
if(typeof callback == 'undefined'){
306+
callback = function(){}
307+
}
308+
this.changeOff(id);
304309
this.editors[id].destroy();
305310
this.createEditor(id,offloadImages,()=>{});
306-
this.changeOff(id);
307311
this.editors[id].hide();
308312
if (isEncoded) {
309313
contents = this.b64DecodeUnicode(contents)

src/com/fuse/utils/FSUtils.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,13 @@ public static String sanitizeHTML(String html) {
125125
PolicyFactory policyBuilder = new HtmlPolicyBuilder().allowAttributes("src").onElements("img")
126126
.allowUrlProtocols("data", "http", "https").allowAttributes("href").onElements("a")
127127
.allowAttributes("src", "width", "height", "controls").onElements("video")
128-
.allowAttributes("style", "class")
129-
.onElements("a", "label", "h1", "h2", "h3", "h4", "h5", "h6", "p", "i", "b", "u", "strong", "em",
128+
.allowAttributes("style", "class", "colspan").onElements("a", "label", "h1", "h2", "h3", "h4", "h5", "h6", "p", "i", "b", "u", "strong", "em",
130129
"small", "big", "pre", "code", "cite", "samp", "sub", "sup", "strike", "center", "blockquote",
131130
"hr", "br", "col", "font", "div", "img", "ul", "ol", "li", "dd", "dt", "dl", "tbody", "thead",
132131
"tfoot", "table", "td", "th", "tr", "colgroup", "fieldset", "legend", "span")
133132
.allowAttributes("data-changedata", "data-cid", "data-last-change-time", "data-time", "data-userid",
134-
"data-username", "title")
135-
.onElements("span").allowAttributes("border", "cellpadding", "cellspacing", "style", "class").onElements("table")
133+
"data-username", "title").onElements("span")
134+
.allowAttributes("border", "cellpadding", "cellspacing", "style", "class", "colspan").onElements("table")
136135
.allowStandardUrlProtocols()
137136
.allowElements("a", "label", "h1", "h2", "h3", "h4", "h5", "h6", "p", "i", "b", "u", "strong", "em",
138137
"small", "big", "pre", "code", "cite", "samp", "sub", "sup", "strike", "center", "blockquote",

0 commit comments

Comments
 (0)