From 245fb2e8c431630203fdc5ea5bb1813d82cd742e Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Mon, 19 Feb 2024 17:08:49 +0000 Subject: [PATCH] Bug 36047: Add apos and quot to escapeHtml core function --- koha-tmpl/intranet-tmpl/prog/js/staff-global.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js index ab24a9304e2..4336b667c6e 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js +++ b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js @@ -19,10 +19,12 @@ function formatstr(str, col) { var HtmlCharsToEscape = { '&': '&', '<': '<', - '>': '>' + '>': '>', + "'": ''', + '"': '"' }; String.prototype.escapeHtml = function() { - return this.replace(/[&<>]/g, function(c) { + return this.replace(/["'&<>]/g, function(c) { return HtmlCharsToEscape[c] || c; }); }; -- 2.30.2