From 57c2887ab49821374ab9a684ee5ca79d0ee3f4b9 Mon Sep 17 00:00:00 2001 From: diptanilsaha Date: Tue, 18 Aug 2026 22:49:43 +0530 Subject: [PATCH] fix: escape attribute values in shared client side templates --- erpnext/public/js/templates/call_link.html | 4 +- .../public/js/templates/crm_activities.html | 12 ++-- .../js/templates/shop_floor_template.html | 70 +++++++++---------- 3 files changed, 43 insertions(+), 43 deletions(-) diff --git a/erpnext/public/js/templates/call_link.html b/erpnext/public/js/templates/call_link.html index 2ae1be68bfd..627d5ec543c 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 30b8d0444bc..683f3011409 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) { %} @@ -89,7 +89,7 @@ {% } %}
@@ -114,13 +114,13 @@ - + {%= events[i].subject %}
+ name="{{ frappe.utils.escape_html(events[i].name) }}" title="{{ __('Mark As Closed') }}">
@@ -161,7 +161,7 @@ - + {%= event.subject %}
diff --git a/erpnext/public/js/templates/shop_floor_template.html b/erpnext/public/js/templates/shop_floor_template.html index 09aa2bd6761..0adc8432629 100644 --- a/erpnext/public/js/templates/shop_floor_template.html +++ b/erpnext/public/js/templates/shop_floor_template.html @@ -704,7 +704,7 @@
{% if (slot.item_image) { %} - + {% } else { %} {{ frappe.get_abbr(slot.finished_good || slot.production_item, 2) }} {% } %} @@ -715,7 +715,7 @@ {% if (slot.is_subcontracted) { %} {{ __("Subcontract") }} {% } %} - {{ slot.name }} + {{ slot.name }}
{{ slot.operation }} · {{ format_number(slot.for_quantity, null, 0) }} {{ slot.fg_uom || '' }} @@ -724,11 +724,11 @@
{% if (slot._materials_ready) { %} - {% } else { %} - {% } %} @@ -740,7 +740,7 @@
{% if (slot.item_image) { %} - + {% } else { %} {{ frappe.get_abbr(slot.finished_good || slot.production_item, 2) }} {% } %} @@ -748,7 +748,7 @@
{{ slot.finished_good || slot.production_item }}
- {{ slot.name }} + {{ slot.name }} {{ __(slot.status) }} {% if (slot.is_subcontracted) { %} {{ __("Subcontract") }} @@ -758,31 +758,31 @@ {% } else if (slot.qc && slot.qc.status === 'Rejected') { %} {{ __("QC Rejected") }} {% } else if (slot.qc && slot.qc.required) { %} - {{ __("QC Required") }} + {{ __("QC Required") }} {% } else if (slot.qc && slot.qc.has_checklist) { %} - {{ __("QC Available") }} + {{ __("QC Available") }} {% } %}
{{ slot.operation }} · {{ format_number(slot.total_completed_qty, null, 0) }}/{{ format_number(slot.for_quantity, null, 0) }} {{ slot.fg_uom || '' }} - {% if (slot.work_order) { %} · {{ slot.work_order }}{% } %} + {% if (slot.work_order) { %} · {{ slot.work_order }}{% } %}
-
+
00:00:00
{% if (slot.is_paused) { %} - {% } else { %} - - {% } %} @@ -800,7 +800,7 @@ {% var ready_n = slot.materials.filter((x) => x.status === 'ready').length; %} {% var avail_n = slot.materials.filter((x) => x.status === 'available').length; %} {% var short_n = slot.materials.filter((x) => x.status === 'short').length; %} -
+
@@ -814,7 +814,7 @@ {% if (slot.make_material_request && !slot._is_next_up) { %} - {% } %} @@ -843,7 +843,7 @@ {% } %} {% if (slot && slot.instructions) { %} -
+
{{ frappe.utils.icon("es-line-down", "sm") }} {{ __("Work Instructions") }} @@ -889,19 +889,19 @@
- {% if (jc.item_image) { %}{% } else { %}{{ frappe.get_abbr(jc.finished_good || jc.production_item, 2) }}{% } %} + {% if (jc.item_image) { %}{% } else { %}{{ frappe.get_abbr(jc.finished_good || jc.production_item, 2) }}{% } %}
-
{{ jc.finished_good || jc.production_item }}
+
{{ jc.finished_good || jc.production_item }}
{{ jc.operation }}
- +
{{ format_number(jc.total_completed_qty, null, 0) }} / {{ format_number(jc.for_quantity, null, 0) }} {{ jc.fg_uom || '' }}
-
@@ -930,19 +930,19 @@
- {% if (jc.item_image) { %}{% } else { %}{{ frappe.get_abbr(jc.finished_good || jc.production_item, 2) }}{% } %} + {% if (jc.item_image) { %}{% } else { %}{{ frappe.get_abbr(jc.finished_good || jc.production_item, 2) }}{% } %}
-
{{ jc.finished_good || jc.production_item }}
+
{{ jc.finished_good || jc.production_item }}
{{ jc.operation }}
- +
{{ format_number(jc.total_completed_qty, null, 0) }} / {{ format_number(jc.for_quantity, null, 0) }} {{ jc.fg_uom || '' }}
-
@@ -972,12 +972,12 @@
- {% if (jc.item_image) { %}{% } else { %}{{ frappe.get_abbr(jc.finished_good || jc.production_item, 2) }}{% } %} + {% if (jc.item_image) { %}{% } else { %}{{ frappe.get_abbr(jc.finished_good || jc.production_item, 2) }}{% } %}
-
{{ jc.finished_good || jc.production_item }}
+
{{ jc.finished_good || jc.production_item }}
{{ jc.operation }}
- +
{{ format_number(jc.for_quantity, null, 0) }} {{ jc.fg_uom || '' }} @@ -987,11 +987,11 @@
{% if (jc._materials_ready) { %} - {% } else { %} - {% } %} @@ -1022,12 +1022,12 @@
- {% if (jc.item_image) { %}{% } else { %}{{ frappe.get_abbr(jc.finished_good || jc.production_item, 2) }}{% } %} + {% if (jc.item_image) { %}{% } else { %}{{ frappe.get_abbr(jc.finished_good || jc.production_item, 2) }}{% } %}
-
{{ jc.finished_good || jc.production_item }}
+
{{ jc.finished_good || jc.production_item }}
{{ jc.operation }}
- +
{{ format_number(jc.total_completed_qty, null, 0) }} / {{ format_number(jc.for_quantity, null, 0) }} {{ jc.fg_uom || '' }} @@ -1060,12 +1060,12 @@
- {% if (s.item_image) { %}{% } else { %}{{ frappe.get_abbr(s.finished_good || s.production_item, 2) }}{% } %} + {% if (s.item_image) { %}{% } else { %}{{ frappe.get_abbr(s.finished_good || s.production_item, 2) }}{% } %}
-
{{ s.finished_good || s.production_item }}
+
{{ s.finished_good || s.production_item }}
{{ s.operation }}
- +
{{ format_number(s.total_completed_qty, null, 0) }} / {{ format_number(s.for_quantity, null, 0) }} {% if (cint(s.process_loss_qty) > 0) { %}
{{ __("Loss") }}: {{ format_number(s.process_loss_qty, null, 0) }}
{% } %}