fix(security): XSS in display area
This commit is contained in:
parent
de00a651cc
commit
1c450877b0
1 changed files with 7 additions and 4 deletions
|
|
@ -119,9 +119,12 @@ frappe.ui.form.ControlInput = frappe.ui.form.Control.extend({
|
|||
} else {
|
||||
value = this.value || value;
|
||||
}
|
||||
this.disp_area && $(this.disp_area)
|
||||
.html(frappe.format(value, this.df, {no_icon:true, inline:true},
|
||||
this.doc || (this.frm && this.frm.doc)));
|
||||
if (this.df.fieldtype === 'Data') {
|
||||
value = frappe.utils.escape_html(value);
|
||||
}
|
||||
let doc = this.doc || (this.frm && this.frm.doc);
|
||||
let display_value = frappe.format(value, this.df, {no_icon:true, inline:true}, doc);
|
||||
this.disp_area && $(this.disp_area).html(display_value);
|
||||
},
|
||||
|
||||
bind_change_event: function() {
|
||||
|
|
@ -184,4 +187,4 @@ frappe.ui.form.ControlInput = frappe.ui.form.Control.extend({
|
|||
$(this.disp_area).toggleClass("bold", !!(this.df.bold || this.df.reqd));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue