From 66093db5face6a8e08e0c68e31e12a1f6b2db6f1 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Sat, 24 Oct 2026 17:19:52 -0700 Subject: [PATCH] case 4721 - client escaping of record text Record text shown as HTML is escaped: unit warranty summary (vendor name, receipt number), work-order address dialog (now plain text), search excerpt (escaped, search terms highlighted as plain text, not as a regular expression). Confirmation dialog messages are sanitised with DOMPurify. Co-Authored-By: Claude Opus 5.5 --- ayanova/src/api/gzutil.js | 14 ++++++ ayanova/src/components/gzconfirm.vue | 12 +++-- ayanova/src/components/pm-item-units.vue | 6 ++- ayanova/src/components/quote-item-units.vue | 6 ++- ayanova/src/components/work-order-address.vue | 4 +- .../src/components/work-order-item-units.vue | 6 ++- ayanova/src/views/home-search.vue | 46 +++++++++++++++---- 7 files changed, 73 insertions(+), 21 deletions(-) diff --git a/ayanova/src/api/gzutil.js b/ayanova/src/api/gzutil.js index 23882da8..128139fd 100644 --- a/ayanova/src/api/gzutil.js +++ b/ayanova/src/api/gzutil.js @@ -646,6 +646,20 @@ export default { return str != null && typeof str.valueOf() === "string"; }, /////////////////////////////////////////////// + // case 4721: escape text that goes into HTML (v-html) so it shows as text + // + escapeHtml: function(str) { + if (str === null || str === undefined) { + return ""; + } + return String(str) + .replace(/&/g, "&") + .replace(//g, ">") + .replace(/"/g, """) + .replace(/'/g, "'"); + }, + /////////////////////////////////////////////// // // // diff --git a/ayanova/src/components/gzconfirm.vue b/ayanova/src/components/gzconfirm.vue index f99a5fd1..d8faee09 100644 --- a/ayanova/src/components/gzconfirm.vue +++ b/ayanova/src/components/gzconfirm.vue @@ -31,10 +31,7 @@ {{ options.title }} - + @@ -82,6 +79,7 @@