Skip to content

Commit

Permalink
fix: escape text types before setting disp area (#25520) (#25522)
Browse files Browse the repository at this point in the history
(cherry picked from commit fa6ec99)

Co-authored-by: Ankush Menat <ankush@frappe.io>
  • Loading branch information
mergify[bot] and ankush committed Mar 18, 2024
1 parent 3344df0 commit e446770
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion frappe/public/js/frappe/form/controls/base_input.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,12 @@ frappe.ui.form.ControlInput = class ControlInput extends frappe.ui.form.Control
} else {
value = this.value || value;
}
if (this.df.fieldtype === "Data") {
if (["Data", "Long Text", "Small Text", "Text", "Password"].includes(this.df.fieldtype)) {
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 is used to display formatted output AND showing values in read only fields
this.disp_area && $(this.disp_area).html(display_value);
}
set_label(label) {
Expand Down

0 comments on commit e446770

Please sign in to comment.