From 8b0b6d43fa22891cdd7cecdb5ec440af72eb52f0 Mon Sep 17 00:00:00 2001 From: Cihad Tekin Date: Mon, 6 Jan 2025 16:46:26 +0300 Subject: [PATCH 1/2] [star-rating] Unescape the properties shown in the list --- .../frontend/public/javascripts/countly.models.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/plugins/star-rating/frontend/public/javascripts/countly.models.js b/plugins/star-rating/frontend/public/javascripts/countly.models.js index dfb61ee7f42..9bd1938c05d 100644 --- a/plugins/star-rating/frontend/public/javascripts/countly.models.js +++ b/plugins/star-rating/frontend/public/javascripts/countly.models.js @@ -1,4 +1,4 @@ -/*global countlyCommon, app, jQuery, $*/ +/*global countlyCommon, app, jQuery,_ $*/ (function(starRatingPlugin) { var _pv = {}; // feedbackd datas @@ -271,6 +271,15 @@ app_id: countlyCommon.ACTIVE_APP_ID }, success: function(json) { + // unescape the properties shown in the list + json.forEach(row => { + if (typeof row?.internalName === "string") { + row.internalName = _.unescape(row.internalName).replace(/'/g, "'"); + } + if (typeof row?.targeting?.user_segmentation === "string") { + row.targeting.user_segmentation = _.unescape(row.targeting.user_segmentation).replace(/'/g, "'"); + } + }); _fwd = json; } }); From dbc39d47780f59a004206f0f96acb8ef0843f029 Mon Sep 17 00:00:00 2001 From: Cihad Tekin Date: Fri, 10 Jan 2025 14:43:25 +0300 Subject: [PATCH 2/2] [star-rating] Replaced _.unescape with countlyCommon.unescapeHtml --- .../star-rating/frontend/public/javascripts/countly.models.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/star-rating/frontend/public/javascripts/countly.models.js b/plugins/star-rating/frontend/public/javascripts/countly.models.js index 9bd1938c05d..a1daca86e94 100644 --- a/plugins/star-rating/frontend/public/javascripts/countly.models.js +++ b/plugins/star-rating/frontend/public/javascripts/countly.models.js @@ -274,10 +274,10 @@ // unescape the properties shown in the list json.forEach(row => { if (typeof row?.internalName === "string") { - row.internalName = _.unescape(row.internalName).replace(/'/g, "'"); + row.internalName = countlyCommon.unescapeHtml(row.internalName); } if (typeof row?.targeting?.user_segmentation === "string") { - row.targeting.user_segmentation = _.unescape(row.targeting.user_segmentation).replace(/'/g, "'"); + row.targeting.user_segmentation = countlyCommon.unescapeHtml(row.targeting.user_segmentation); } }); _fwd = json;