Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: escape text types before setting disp area #25520

Merged
merged 1 commit into from
Mar 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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