Skip to content

Commit e1cb536

Browse files
committed
Various others
1 parent 7023c7e commit e1cb536

File tree

12 files changed

+27
-27
lines changed

12 files changed

+27
-27
lines changed

src/controllers/CatalogPricingRulesController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public function actionIndex(?string $storeHandle = null): Response
103103

104104
$tableData[] = [
105105
'id' => $pcr->id,
106-
'title' => Craft::t('site', $pcr->name),
106+
'title' => Html::encode(Craft::t('site', $pcr->name)),
107107
'url' => $pcr->getCpEditUrl(),
108108
'status' => $pcr->enabled ? true : false,
109109
'duration' => $dateRange,

src/controllers/DiscountsController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ public function actionTableData(): Response
275275

276276
$tableData[] = [
277277
'id' => $item['id'],
278-
'title' => Craft::t('site', $item['name']),
278+
'title' => Html::encode(Craft::t('site', $item['name'])),
279279
'url' => UrlHelper::cpUrl('commerce/store-management/' . $store->handle . '/discounts/' . $item['id']),
280280
'status' => (bool)$item['enabled'],
281281
'duration' => $dateRange,

src/controllers/GatewaysController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ public function actionIndex(): Response
4949
$missing = $gateway instanceof MissingGateway;
5050
$gateway = [
5151
'id' => $gateway->id,
52-
'title' => Craft::t('site', $gateway->name),
52+
'title' => Html::encode(Craft::t('site', $gateway->name)),
5353
'handle' => Html::encode($gateway->handle),
5454
'type' => [
5555
'missing' => $missing,
56-
'name' => $missing ? $gateway->expectedType : $gateway->displayName(),
56+
'name' => Html::encode($missing ? $gateway->expectedType : $gateway->displayName()),
5757
],
5858
'hasTransactions' => in_array($gateway->id, $gatewayIdsWithTransactions),
5959
];

src/templates/orders/_transactions.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ var columns = [
2828
callback: function(value) {
2929
return '<span style="padding-left: '+value.level+'em;">'+
3030
((value.level) ? '<span class="extralight">&#8627;</span> ' : '') +
31-
value.label+'</span>';
31+
Craft.escapeHtml(value.label)+'</span>';
3232
}
3333
},
3434
{ name: 'status', title: Craft.t('commerce', 'Status'),
3535
callback: function(value) {
36-
return '<span class="transaction-status transaction-status-'+value.key+'">'+value.label+'</span>';
36+
return '<span class="transaction-status transaction-status-'+Craft.escapeHtml(value.key)+'">'+Craft.escapeHtml(value.label)+'</span>';
3737
}
3838
},
3939
{ name: 'amount', title: Craft.t('commerce', 'Amount'),

src/templates/promotions/sales/index.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
{% endif %}
4949
{% set tableData = tableData|merge([{
5050
id: sale.id,
51-
title: sale.name|t('site'),
51+
title: sale.name|t('site')|e,
5252
url: sale.getCpEditUrl(),
5353
status: sale.enabled ? true : false,
5454
duration: dateRange,

src/templates/settings/emails/index.twig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@
4646
{% for email in storeEmails %}
4747
{% set tableData = tableData|merge([{
4848
id: email.id,
49-
title: email.name|t('site'),
49+
title: email.name|t('site')|e,
5050
status: email.enabled ? true : false,
5151
url: email.getCpEditUrl(),
5252
subject: email.subject|t('site')|e,
5353
to: email.recipientType == 'custom' ? email.to|e : 'Customer'|t('commmerce')|e,
5454
bcc: email.bcc|e,
55-
template: email.templatePath,
55+
template: email.templatePath|e,
5656
preview: email.id ~ ':' ~ email.storeId,
5757
}]) %}
5858
{% endfor %}
@@ -66,7 +66,7 @@
6666
{ name: 'template', title: Craft.t('commerce', 'Template Path'),
6767
callback: function(value) {
6868
if (value) {
69-
return '<span class="code">'+value+'</span>';
69+
return '<span class="code">'+Craft.escapeHtml(value)+'</span>';
7070
}
7171

7272
return '';

src/templates/settings/gateways/index.twig

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@
5353
{% for gateway in gateways %}
5454
{% set tableData = tableData|merge([{
5555
id: gateway.id,
56-
title: gateway.name|t('site'),
56+
title: gateway.name|t('site')|e,
5757
url: gateway.getCpEditUrl(),
5858
handle: gateway.handle|e,
5959
type: {
6060
missing: gateway is missing ? true : false,
61-
name: gateway is missing? gateway.expectedType : gateway.displayName()
61+
name: (gateway is missing? gateway.expectedType : gateway.displayName())|e
6262
},
6363
customerEnabled: parseBooleanEnv(gateway.isFrontendEnabled),
6464
}]) %}
@@ -95,10 +95,10 @@
9595
title: Craft.t('commerce', 'Type'),
9696
callback: function(value) {
9797
if (value.missing) {
98-
return '<span class="error">'+value.name+'</span>';
98+
return '<span class="error">'+Craft.escapeHtml(value.name)+'</span>';
9999
}
100100

101-
return value.name;
101+
return Craft.escapeHtml(value.name);
102102
}
103103
},
104104
{
@@ -138,10 +138,10 @@
138138
title: Craft.t('commerce', 'Type'),
139139
callback: function(value) {
140140
if (value.missing) {
141-
return '<span class="error">'+value.name+'</span>';
141+
return '<span class="error">'+Craft.escapeHtml(value.name)+'</span>';
142142
}
143143

144-
return value.name;
144+
return Craft.escapeHtml(value.name);
145145
}
146146
},
147147
{

src/templates/settings/lineitemstatuses/index.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
url: lineItemStatus.cpEditUrl,
5757
html: lineItemStatus.labelHtml|raw
5858
},
59-
title: lineItemStatus.name|t('site'),
59+
title: lineItemStatus.name|t('site')|e,
6060
url: lineItemStatus.cpEditUrl,
6161
handle: lineItemStatus.handle|e,
6262
default: lineItemStatus.default ? true : false,

src/templates/settings/pdfs/index.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@
5050
{% for pdf in storePdfs %}
5151
{% set tableData = tableData|merge([{
5252
id: pdf.id,
53-
title: pdf.name|t('site'),
54-
handle: pdf.handle|t('site'),
53+
title: pdf.name|t('site')|e,
54+
handle: pdf.handle|e,
5555
status: pdf.enabled ? true : false,
5656
url:pdf.getCpEditUrl(),
5757
isDefault: pdf.isDefault ? true : false,

src/templates/settings/stores/index.twig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@
3838
{% for store in stores %}
3939
{% set tableData = tableData|merge([{
4040
id: store.id,
41-
name: store.name|t('site'),
42-
title: store.name|t('site'),
41+
name: store.name|t('site')|e,
42+
title: store.name|t('site')|e,
4343
url: url('commerce/settings/stores/'~store.id),
44-
handle: store.handle,
44+
handle: store.handle|e,
4545
currency: store.currency,
4646
primary: store.primary ? true : false,
47-
sites: store.getSiteNames()|join(', '),
47+
sites: store.getSiteNames()|join(', ')|e,
4848
menu: {
4949
showItems: true,
5050
showCount: false,

0 commit comments

Comments
 (0)