Skip to content

Commit fa27333

Browse files
committed
Fix encoding
1 parent b9da26f commit fa27333

7 files changed

Lines changed: 12 additions & 12 deletions

src/controllers/InventoryLocationsController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ public function actionInventoryLocationsTableData(): Response
331331
'id' => $inventoryLocation->id,
332332
'title' => $inventoryLocation->getUiLabel(),
333333
'handle' => $inventoryLocation->handle,
334-
'address' => $inventoryLocation->getAddressLine(),
334+
'address' => Html::encode($inventoryLocation->getAddressLine()),
335335
'url' => $inventoryLocation->getCpEditUrl(),
336336
'delete' => $inventoryLocations->count() > 1 ? $deleteButton : '',
337337
];

src/controllers/ShippingCategoriesController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function actionIndex(?string $storeHandle = null): Response
4646
// Generate table data with chips
4747
$tableData = [];
4848
foreach ($shippingCategories as $shippingCategory) {
49-
$label = Craft::t('site', $shippingCategory->name);
49+
$label = Html::encode(Craft::t('site', $shippingCategory->name));
5050
$tableData[] = [
5151
'id' => $shippingCategory->id,
5252
'title' => $label,
@@ -57,7 +57,7 @@ public function actionIndex(?string $storeHandle = null): Response
5757
]),
5858
'url' => $shippingCategory->getCpEditUrl(),
5959
'handle' => $shippingCategory->handle,
60-
'description' => Craft::t('site', $shippingCategory->description),
60+
'description' => Html::encode(Craft::t('site', $shippingCategory->description)),
6161
'default' => $shippingCategory->default,
6262
'_showDelete' => (count($shippingCategories) > 1 && !$shippingCategory->default),
6363
];

src/controllers/ShippingMethodsController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function actionIndex(?string $storeHandle = null): Response
4444
// Generate table data with chips
4545
$tableData = [];
4646
foreach ($shippingMethods as $shippingMethod) {
47-
$label = Craft::t('site', $shippingMethod->name);
47+
$label = Html::encode(Craft::t('site', $shippingMethod->name));
4848
$tableData[] = [
4949
'id' => $shippingMethod->id,
5050
'title' => $label,

src/controllers/ShippingZonesController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ public function actionIndex(?string $storeHandle = null): Response
4141
// Generate table data
4242
$tableData = [];
4343
foreach ($shippingZones as $shippingZone) {
44-
$label = Craft::t('site', $shippingZone->name);
44+
$label = Html::encode(Craft::t('site', $shippingZone->name));
4545
$tableData[] = [
4646
'id' => $shippingZone->id,
4747
'title' => Html::a($label, $shippingZone->getCpEditUrl()),
4848
'url' => $shippingZone->getCpEditUrl(),
49-
'description' => Craft::t('site', $shippingZone->description),
49+
'description' => Html::encode(Craft::t('site', $shippingZone->description)),
5050
];
5151
}
5252

src/controllers/TaxCategoriesController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function actionIndex(?string $storeHandle = null): Response
4848
// Generate table data with chips
4949
$tableData = [];
5050
foreach ($taxCategories as $taxCategory) {
51-
$label = Craft::t('site', $taxCategory->name);
51+
$label = Html::encode(Craft::t('site', $taxCategory->name));
5252
$taxRates = $taxCategory->getTaxRates($store->id);
5353
$tableData[] = [
5454
'id' => $taxCategory->id,
@@ -60,7 +60,7 @@ public function actionIndex(?string $storeHandle = null): Response
6060
]),
6161
'url' => $taxCategory->getCpEditUrl($store->id),
6262
'handle' => $taxCategory->handle,
63-
'description' => Craft::t('site', $taxCategory->description),
63+
'description' => Html::encode(Craft::t('site', $taxCategory->description)),
6464
'default' => $taxCategory->default,
6565
'_showDelete' => $taxRates->isEmpty() && (count($taxCategories) > 1 && !$taxCategory->default),
6666
];

src/controllers/TaxRatesController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function actionIndex(?string $storeHandle = null): Response
5757
// Generate table data
5858
$tableData = [];
5959
foreach ($taxRates as $taxRate) {
60-
$label = Craft::t('site', $taxRate->name);
60+
$label = Html::encode(Craft::t('site', $taxRate->name));
6161
$tableData[] = [
6262
'id' => $taxRate->id,
6363
'status' => $taxRate->enabled,
@@ -67,7 +67,7 @@ public function actionIndex(?string $storeHandle = null): Response
6767
'included' => $taxRate->include,
6868
'removeIncluded' => $taxRate->removeIncluded,
6969
'vat' => $taxRate->isVat,
70-
'zone' => $taxRate->isEverywhere ? Craft::t('commerce', 'Everywhere') : ($taxRate->taxZone ? $taxRate->taxZone->name : ''),
70+
'zone' => $taxRate->isEverywhere ? Craft::t('commerce', 'Everywhere') : ($taxRate->taxZone ? Html::encode($taxRate->taxZone->name) : ''),
7171
'category' => $taxRate->taxCategory ? Cp::chipHtml($taxRate->taxCategory) : '',
7272
];
7373
}

src/controllers/TaxZonesController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ public function actionIndex(?string $storeHandle = null): Response
4949
// Generate table data
5050
$tableData = [];
5151
foreach ($taxZones as $taxZone) {
52-
$label = Craft::t('site', $taxZone->name);
52+
$label = Html::encode(Craft::t('site', $taxZone->name));
5353
$tableData[] = [
5454
'id' => $taxZone->id,
5555
'title' => Html::a($label, $taxZone->getCpEditUrl()),
5656
'url' => $taxZone->getCpEditUrl(),
57-
'description' => Craft::t('site', $taxZone->description),
57+
'description' => Html::encode(Craft::t('site', $taxZone->description)),
5858
'default' => $taxZone->default,
5959
];
6060
}

0 commit comments

Comments
 (0)