diff --git a/erpnext/manufacturing/doctype/bom/bom.js b/erpnext/manufacturing/doctype/bom/bom.js index 88a6c3bad66..4608cbcb6cf 100644 --- a/erpnext/manufacturing/doctype/bom/bom.js +++ b/erpnext/manufacturing/doctype/bom/bom.js @@ -173,7 +173,9 @@ frappe.ui.form.on("BOM", { frm.set_intro( __("This is a Template BOM and will be used to make the work order for {0} of the item {1}", [ `variants`, - `${frm.doc.item}`, + `${frappe.utils.escape_html( + frm.doc.item + )}`, ]), true ); diff --git a/erpnext/manufacturing/doctype/bom/bom_item_preview.html b/erpnext/manufacturing/doctype/bom/bom_item_preview.html index 2c0f091da58..15d121e5caf 100644 --- a/erpnext/manufacturing/doctype/bom/bom_item_preview.html +++ b/erpnext/manufacturing/doctype/bom/bom_item_preview.html @@ -17,11 +17,11 @@

{% if data.value && data.value != "BOM" %} - + {{ __("Open BOM {0}", [data.value.bold()]) }} {% endif %} {% if data.item_code %} - + {{ __("Open Item {0}", [data.item_code.bold()]) }} {% endif %}

diff --git a/erpnext/manufacturing/doctype/work_order/work_order_preview.html b/erpnext/manufacturing/doctype/work_order/work_order_preview.html index 95bdd291ee0..112c8d8250e 100644 --- a/erpnext/manufacturing/doctype/work_order/work_order_preview.html +++ b/erpnext/manufacturing/doctype/work_order/work_order_preview.html @@ -20,11 +20,11 @@

{% if data.value %} - + {{ __("Open Work Order {0}", [data.value.bold()]) }} {% endif %} {% if data.item_code %} - + {{ __("Open Item {0}", [data.item_code.bold()]) }} {% endif %}

diff --git a/erpnext/manufacturing/doctype/workstation/workstation_job_card.html b/erpnext/manufacturing/doctype/workstation/workstation_job_card.html index 97707855db0..db3d3bffcc3 100644 --- a/erpnext/manufacturing/doctype/workstation/workstation_job_card.html +++ b/erpnext/manufacturing/doctype/workstation/workstation_job_card.html @@ -11,7 +11,7 @@
{% $.each(data, (idx, d) => { %} - @@ -77,7 +77,7 @@
{% if(d.make_material_request) { %}
- +
{% } %} diff --git a/erpnext/manufacturing/report/production_plan_summary/production_plan_summary.js b/erpnext/manufacturing/report/production_plan_summary/production_plan_summary.js index 0e89a25c228..8536ccd1993 100644 --- a/erpnext/manufacturing/report/production_plan_summary/production_plan_summary.js +++ b/erpnext/manufacturing/report/production_plan_summary/production_plan_summary.js @@ -23,7 +23,10 @@ frappe.query_reports["Production Plan Summary"] = { if (column.fieldname == "item_code") { var color = data.pending_qty > 0 ? "red" : "green"; - value = `${data["item_code"]}`; + value = `${frappe.utils.escape_html(data["item_code"])}`; } return value; diff --git a/erpnext/projects/doctype/project/project_dashboard.html b/erpnext/projects/doctype/project/project_dashboard.html index 1f299e30833..d8467317582 100644 --- a/erpnext/projects/doctype/project/project_dashboard.html +++ b/erpnext/projects/doctype/project/project_dashboard.html @@ -3,7 +3,7 @@ {% for d in data %}
- + {{ d.activity_type || __("Unknown") }}
diff --git a/erpnext/public/js/templates/call_link.html b/erpnext/public/js/templates/call_link.html index 071078c776e..bb49c6b402b 100644 --- a/erpnext/public/js/templates/call_link.html +++ b/erpnext/public/js/templates/call_link.html @@ -8,7 +8,7 @@ • {{ comment_when(creation) }}
- + @@ -34,7 +34,7 @@
{% } %} diff --git a/erpnext/public/js/templates/crm_activities.html b/erpnext/public/js/templates/crm_activities.html index 42603196087..8699ee596e1 100644 --- a/erpnext/public/js/templates/crm_activities.html +++ b/erpnext/public/js/templates/crm_activities.html @@ -30,13 +30,13 @@
- + {%= tasks[i].description %}
+ name="{{ frappe.utils.escape_html(tasks[i].name) }}" title="{{ __('Mark As Closed') }}">
{% if(tasks[i].date) { %} @@ -73,13 +73,13 @@ - + {%= events[i].subject %}
+ name="{{ frappe.utils.escape_html(events[i].name) }}" title="{{ __('Mark As Closed') }}">
diff --git a/erpnext/stock/doctype/item/item.js b/erpnext/stock/doctype/item/item.js index 47dd2f50656..cfdb4d04250 100644 --- a/erpnext/stock/doctype/item/item.js +++ b/erpnext/stock/doctype/item/item.js @@ -188,7 +188,10 @@ frappe.ui.form.on("Item", { if (frm.doc.variant_of) { frm.set_intro( __("This Item is a Variant of {0} (Template).", [ - `${frm.doc.variant_of}`, + `${frappe.utils.escape_html(frm.doc.variant_of)}`, ]), true ); diff --git a/erpnext/stock/doctype/shipment/shipment.js b/erpnext/stock/doctype/shipment/shipment.js index f22139c89f5..9c86fefc183 100644 --- a/erpnext/stock/doctype/shipment/shipment.js +++ b/erpnext/stock/doctype/shipment/shipment.js @@ -174,7 +174,10 @@ frappe.ui.form.on("Shipment", { __("Email or Phone/Mobile of the Contact are mandatory to continue.") + "
" + __("Please set Email/Phone for the contact") + - ` ${contact_name}` + ` ${frappe.utils.escape_html(contact_name)}` ); } let contact_display = r.message.contact_display; diff --git a/erpnext/templates/form_grid/includes/visible_cols.html b/erpnext/templates/form_grid/includes/visible_cols.html index 3a0cc8d7239..578335ddcd4 100644 --- a/erpnext/templates/form_grid/includes/visible_cols.html +++ b/erpnext/templates/form_grid/includes/visible_cols.html @@ -3,7 +3,7 @@ if((df.fieldname !== "description" && df.fieldname !== "item_name") && val) { %}
- {%= __(df.label) %}: + {%= frappe.utils.escape_html(__(df.label, null, df.parent)) %}:
{%= doc.get_formatted(df.fieldname) %} diff --git a/erpnext/templates/form_grid/item_grid.html b/erpnext/templates/form_grid/item_grid.html index 72db6c8e653..fac31c7c1a1 100644 --- a/erpnext/templates/form_grid/item_grid.html +++ b/erpnext/templates/form_grid/item_grid.html @@ -31,7 +31,7 @@ } %} - {%= doc.warehouse %} + {%= frappe.utils.escape_html(doc.warehouse) %} {% } %} @@ -42,14 +42,14 @@ doc.delivered_qty : doc.received_qty; var pending = flt(doc.qty) - flt(delivered); %} - {%= doc.item_code %} + {%= frappe.utils.escape_html(doc.item_code) %} {% } else { %} - {%= doc.item_code %} + {%= frappe.utils.escape_html(doc.item_code) %} {% } %} {% if(doc.item_name != doc.item_code && in_list(visible_column_fieldnames, "item_name")) { %} {% if (doc.item_code) { %}
{% } %} - {%= doc.item_name %}{% } %} + {%= frappe.utils.escape_html(doc.item_name) %}{% } %} {% include "templates/form_grid/includes/visible_cols.html" %}
@@ -57,7 +57,7 @@ @@ -84,7 +84,7 @@ {% if (frappe.perm.is_visible("rate", doc, frm.perm)) { %}
- {%= doc.get_formatted("qty") %} {%= doc.uom || doc.stock_uom %} + {%= doc.get_formatted("qty") %} {%= frappe.utils.escape_html(doc.uom || doc.stock_uom) %} x {%= doc.get_formatted("rate") %}
{% } %} diff --git a/erpnext/templates/form_grid/material_request_grid.html b/erpnext/templates/form_grid/material_request_grid.html index 866c06e5863..ff58da62ab5 100644 --- a/erpnext/templates/form_grid/material_request_grid.html +++ b/erpnext/templates/form_grid/material_request_grid.html @@ -11,9 +11,9 @@ {% } else { %}
- {%= doc.item_code %} + {%= frappe.utils.escape_html(doc.item_code) %} {% if(doc.item_name != doc.item_code) { %} -
{%= doc.item_name %}{% } %} +
{%= frappe.utils.escape_html(doc.item_name) %}{% } %} {% include "templates/form_grid/includes/visible_cols.html" %} @@ -35,7 +35,7 @@ {% if(doc.warehouse) { %} - {%= doc.warehouse %} + {%= frappe.utils.escape_html(doc.warehouse) %} {% } %}
@@ -43,7 +43,7 @@
{%= doc.get_formatted("qty") %} - {%= doc.uom || doc.stock_uom %} + {%= frappe.utils.escape_html(doc.uom || doc.stock_uom) %}
{% } %} diff --git a/erpnext/templates/form_grid/stock_entry_grid.html b/erpnext/templates/form_grid/stock_entry_grid.html index 8604881812d..d0afa926c50 100644 --- a/erpnext/templates/form_grid/stock_entry_grid.html +++ b/erpnext/templates/form_grid/stock_entry_grid.html @@ -12,9 +12,9 @@
{% } else { %}
-
{%= doc.item_code %} +
{%= frappe.utils.escape_html(doc.item_code) %} {% if(doc.item_name != doc.item_code) { %} -
{%= doc.item_name %}{% } %} +
{%= frappe.utils.escape_html(doc.item_name) %}{% } %} {% include "templates/form_grid/includes/visible_cols.html" %}
@@ -30,11 +30,11 @@ } %} - {%= doc.s_warehouse %} + {%= frappe.utils.escape_html(doc.s_warehouse) %} {% }; %} {% if(doc.t_warehouse) { %}
- {%= doc.t_warehouse %} + {%= frappe.utils.escape_html(doc.t_warehouse) %}
{% }; %}
@@ -42,7 +42,7 @@
{%= doc.get_formatted("qty") %} -
{%= doc.uom || doc.stock_uom %} +
{%= frappe.utils.escape_html(doc.uom || doc.stock_uom) %}
diff --git a/erpnext/templates/generators/sales_partner.html b/erpnext/templates/generators/sales_partner.html index 39138d3c6cc..8c9e75fdf57 100644 --- a/erpnext/templates/generators/sales_partner.html +++ b/erpnext/templates/generators/sales_partner.html @@ -9,8 +9,8 @@
{% if logo -%} - +

{%- endif %}
diff --git a/erpnext/templates/includes/macros.html b/erpnext/templates/includes/macros.html index dc9ee234d9e..5945d487d29 100644 --- a/erpnext/templates/includes/macros.html +++ b/erpnext/templates/includes/macros.html @@ -2,7 +2,7 @@
{% endmacro %} @@ -10,7 +10,7 @@ {% macro product_image(website_image, css_class="product-image", alt="", no_border=False) %}
{% if website_image %} - {{ alt }} + {{ alt | e }} {% else %}
{{ frappe.utils.get_abbr(alt) or "NA" }} @@ -22,11 +22,11 @@ {% macro media_image(website_image, name, css_class="") %} {% endif %}
- Link + Link
diff --git a/erpnext/templates/pages/help.html b/erpnext/templates/pages/help.html index 726d5e1b881..7e11bcb7d54 100644 --- a/erpnext/templates/pages/help.html +++ b/erpnext/templates/pages/help.html @@ -17,12 +17,12 @@ {% for section in get_started_sections %}
-

{{ section["name"] }}

+

{{ section["name"] | e }}

{% for item in section["items"] %}
- {{ item.title }} + {{ item.title | e }} {% if item.description -%} -

{{ item.description }}

+

{{ item.description | e }}

{%- endif %}
{% endfor %} @@ -35,15 +35,15 @@

{{ _("Forum Activity") }}

{% for topic in topics %}
- - {{ topic[post_params.title] }} + + {{ topic[post_params.title] | e }} {% if topic[post_params.description] -%} -

{{ topic[post_params.description] }}

+

{{ topic[post_params.description] | e }}

{%- endif %}
{% endfor %} -

{{ _("Visit the forums") }}

+

{{ _("Visit the forums") }}


diff --git a/erpnext/templates/pages/order.html b/erpnext/templates/pages/order.html index 5563a58b730..3107209a75e 100644 --- a/erpnext/templates/pages/order.html +++ b/erpnext/templates/pages/order.html @@ -151,7 +151,7 @@ {% if doc.terms %}

-

{{ doc.terms }}

+

{{ frappe.sanitize_html(doc.terms) }}

{% endif %} {% endblock %} diff --git a/erpnext/templates/pages/partners.html b/erpnext/templates/pages/partners.html index 72d6a6478f7..71962b90afa 100644 --- a/erpnext/templates/pages/partners.html +++ b/erpnext/templates/pages/partners.html @@ -10,14 +10,14 @@
{% if partner_info.logo -%} - - + + {%- endif %}
- +

{{ partner_info.partner_name }}

{{ partner_info.territory }} - {{ partner_info.partner_type }}

diff --git a/erpnext/templates/pages/projects.html b/erpnext/templates/pages/projects.html index e671e91db2f..10466a6cb2f 100644 --- a/erpnext/templates/pages/projects.html +++ b/erpnext/templates/pages/projects.html @@ -34,7 +34,7 @@ {% if doc.tasks %} diff --git a/erpnext/templates/pages/projects.js b/erpnext/templates/pages/projects.js index 622ed42f85f..24c16268e61 100644 --- a/erpnext/templates/pages/projects.js +++ b/erpnext/templates/pages/projects.js @@ -45,7 +45,7 @@ frappe.ready(function () { dataType: "json", data: { cmd: "erpnext.templates.pages.projects.get_" + item + "_html", - project: "{{ doc.name }}", + project: "{{ doc.name | e }}", item_status: item_status, }, success: function (data) { @@ -80,7 +80,7 @@ frappe.ready(function () { dataType: "json", data: { cmd: "erpnext.templates.pages.projects.get_" + item + "_html", - project: "{{ doc.name }}", + project: "{{ doc.name | e }}", start: start, item_status: item_status, }, @@ -96,7 +96,7 @@ frappe.ready(function () { var close_item = function (item, item_name) { var args = { - project: "{{ doc.name }}", + project: "{{ doc.name | e }}", item_name: item_name, }; frappe.call({ diff --git a/erpnext/templates/print_formats/includes/item_table_description.html b/erpnext/templates/print_formats/includes/item_table_description.html index 7569e50b45c..4ad3d6dd1d1 100644 --- a/erpnext/templates/print_formats/includes/item_table_description.html +++ b/erpnext/templates/print_formats/includes/item_table_description.html @@ -5,7 +5,7 @@ {% if doc.in_format_data("image") and doc.get("image") and "image" in display_columns -%}
- +
{%- endif %} diff --git a/erpnext/www/support/index.html b/erpnext/www/support/index.html index 3c19198cc16..6702e57cae7 100644 --- a/erpnext/www/support/index.html +++ b/erpnext/www/support/index.html @@ -53,7 +53,7 @@

{{ favorite_article['title'] }}

{{ favorite_article['description'] }}

- +
{% endfor %} @@ -72,7 +72,7 @@
{{ item['category'].name }}
{% for article in item['articles'] %} - {{ article.title }} + {{ article.title }} {% endfor %}