Skip to content

Commit 9ead089

Browse files
XSS changes for ratings
1 parent e51fb19 commit 9ead089

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

plugins/star-rating/frontend/public/javascripts/countly.views.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
}
1616

1717
var Drawer = countlyVue.views.create({
18+
mixins: [countlyVue.mixins.commonFormatters],
1819
template: CV.T("/star-rating/templates/drawer.html"),
1920
props: {
2021
settings: Object,
2122
controls: Object
2223
},
23-
mixins: [],
2424
data: function() {
2525
return {
2626
imageSource: '',
@@ -285,7 +285,8 @@
285285
var WidgetsTable = countlyVue.views.create({
286286
template: CV.T("/star-rating/templates/widgets-table.html"),
287287
mixins: [
288-
countlyVue.mixins.auth(FEATURE_NAME)
288+
countlyVue.mixins.auth(FEATURE_NAME),
289+
countlyVue.mixins.commonFormatters
289290
],
290291
props: {
291292
rows: {
@@ -1085,7 +1086,7 @@
10851086
starRatingPlugin.requestSingleWidget(this.$route.params.id, function(widget) {
10861087
self.widget = widget;
10871088
self.widget.popup_header_text = replaceEscapes(self.widget.popup_header_text);
1088-
self.widget.created_at = countlyCommon.formatTimeAgo(self.widget.created_at);
1089+
self.widget.created_at = countlyCommon.formatTimeAgoText(self.widget.created_at).text;
10891090
if (self.cohortsEnabled) {
10901091
self.widget = self.parseTargeting(widget);
10911092
}

plugins/star-rating/frontend/public/templates/drawer.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
</div>
2323
<div class="ratings-drawer__ratings-popup">
2424
<div class="ratings-drawer__rp-question-area" data-test-id="ratings-drawer-ratingspopup-question">
25-
{{ drawerScope.editedObject.popup_header_text }}
25+
{{ unescapeHtml(drawerScope.editedObject.popup_header_text) }}
2626
</div>
2727
<div v-if="drawerScope.editedObject.ratings_texts">
2828
<div class="ratings-drawer__rp-ratings-area" v-if="drawerScope.editedObject.rating_symbol==='emojis'">

plugins/star-rating/frontend/public/templates/widgets-table.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<template v-slot="rowScope">
2323
<div>
2424
<div @click="goWidgetDetail(rowScope.row._id)" :data-test-id="'ratings-widgets-data-table-widget-name-' + rowScope.$index" :class="[rowScope.row.hover && 'bu-is-underlined bu-is-clickable color-primary', 'color-dark-blue-100 text-medium']">
25-
{{rowScope.row.popup_header_text}}
25+
{{unescapeHtml(rowScope.row.popup_header_text)}}
2626
</div>
2727
<div>
2828
<span :data-test-id="'ratings-widgets-data-table-widget-id-label-' + rowScope.$index" class="color-cool-gray-40 text-small bu-has-text-weight-semibold"> {{ i18n('feedback.widget-id') }} </span>

0 commit comments

Comments
 (0)