From a3f5273ffc10cdd2f33525356785c6157aacb406 Mon Sep 17 00:00:00 2001 From: cont_anki Date: Tue, 16 Jan 2024 10:25:46 +0530 Subject: [PATCH] Fixed metadata link for invalid item title(xss) --- geoportal/src/main/webapp/app/search/ItemCard.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/geoportal/src/main/webapp/app/search/ItemCard.js b/geoportal/src/main/webapp/app/search/ItemCard.js index 1d834c42..c37a5f78 100644 --- a/geoportal/src/main/webapp/app/search/ItemCard.js +++ b/geoportal/src/main/webapp/app/search/ItemCard.js @@ -335,7 +335,7 @@ function(declare, lang, array, string, topic, xhr, on, appTopics, domStyle, domC _renderDataHtml: function(item, uri) { console.log(item); var itemHtml = new ItemHtml({ - title: item.title, + title: this._stripDialogTitle(item.title), uri: uri, style: "width: 80%; max-width: 80%; height: 80%; max-height: 80%;", onHide: function() { @@ -897,9 +897,9 @@ function(declare, lang, array, string, topic, xhr, on, appTopics, domStyle, domC } }, - _strip: function(html) { + _stripDialogTitle: function(html) { let doc = new DOMParser().parseFromString(html, 'text/html'); - return doc.body.textContent || ""; + return doc.body.textContent || "Metadata Information"; } });