Skip to content

Commit 67ccf03

Browse files
committed
Fix encoding
1 parent 7753c03 commit 67ccf03

File tree

7 files changed

+9
-9
lines changed

7 files changed

+9
-9
lines changed

src/controllers/GatewaysController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function actionIndex(): Response
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/elements/traits/OrderElementTrait.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,11 @@ protected function tableAttributeHtml(string $attribute): string
110110
}
111111
case 'shippingMethodName':
112112
{
113-
return $this->shippingMethodName ?? '';
113+
return Html::encode($this->shippingMethodName ?? '');
114114
}
115115
case 'gatewayName':
116116
{
117-
return $this->getGateway()->name ?? '';
117+
return Html::encode($this->getGateway()->name ?? '');
118118
}
119119
case 'paidStatus':
120120
{
@@ -216,7 +216,7 @@ protected function tableAttributeHtml(string $attribute): string
216216
case 'orderSite':
217217
{
218218
$site = Craft::$app->getSites()->getSiteById($this->orderSiteId);
219-
return $site->name ?? '';
219+
return Html::encode($site->name ?? '');
220220
}
221221
default:
222222
{

src/models/LineItemStatus.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public function getCpEditUrl(): string
102102

103103
public function getLabelHtml(): string
104104
{
105-
return sprintf('<span class="commerceStatusLabel nowrap"><span class="status %s"></span>%s</span>', $this->color, Html::encode($this->name));
105+
return sprintf('<span class="commerceStatusLabel nowrap"><span class="status %s"></span>%s</span>', Html::encode($this->color), Html::encode($this->name));
106106
}
107107

108108
/**

src/models/OrderStatus.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ public function getEmails(): array
158158

159159
public function getLabelHtml(): string
160160
{
161-
return sprintf('<span class="commerceStatusLabel nowrap"><span class="status %s"></span>%s</span>', $this->color, Html::encode($this->getDisplayName()));
161+
return sprintf('<span class="commerceStatusLabel nowrap"><span class="status %s"></span>%s</span>', Html::encode($this->color), Html::encode($this->getDisplayName()));
162162
}
163163

164164
/**

src/templates/settings/emails/index.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
subject: email.subject|t('site')|e,
2929
to: email.recipientType == 'custom' ? email.to|e : 'Customer'|t('commmerce')|e,
3030
bcc: email.bcc|e,
31-
template: email.templatePath,
31+
template: email.templatePath|e,
3232
preview: email.id,
3333
}]) %}
3434
{% endfor %}

src/templates/settings/gateways/index.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
handle: gateway.handle|e,
4949
type: {
5050
missing: gateway is missing ? true : false,
51-
name: gateway is missing? gateway.expectedType : gateway.displayName()
51+
name: (gateway is missing ? gateway.expectedType : gateway.displayName())|e
5252
},
5353
customerEnabled: parseBooleanEnv(gateway.isFrontendEnabled),
5454
}]) %}

src/templates/settings/pdfs/index.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
{% set tableData = tableData|merge([{
2424
id: pdf.id,
2525
title: pdf.name|t('site'),
26-
handle: pdf.handle|t('site'),
26+
handle: pdf.handle|t('site')|e,
2727
status: pdf.enabled ? true : false,
2828
url: url('commerce/settings/pdfs/'~pdf.id),
2929
isDefault: pdf.isDefault ? true : false,

0 commit comments

Comments
 (0)