Skip to content

Commit b5217d3

Browse files
committed
MAGETWO-63858: Certain ASCII Attribute Values gets transformed to HTML code in attributes
2 parents b340ac4 + ad3a1ce commit b5217d3

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

app/code/Magento/Swatches/Block/Adminhtml/Attribute/Edit/Options/AbstractSwatch.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ public function __construct(
7878
/**
7979
* Create store values
8080
*
81-
* @codeCoverageIgnore
81+
* Method not intended to escape HTML entities
82+
* Escaping will be applied in template files
83+
*
8284
* @param integer $storeId
8385
* @param integer $optionId
8486
* @return array
@@ -88,10 +90,8 @@ protected function createStoreValues($storeId, $optionId)
8890
$value = [];
8991
$storeValues = $this->getStoreOptionValues($storeId);
9092
$swatchStoreValue = isset($storeValues['swatch']) ? $storeValues['swatch'] : null;
91-
$value['store' . $storeId] = isset($storeValues[$optionId]) ?
92-
$this->escapeHtml($storeValues[$optionId]) : '';
93-
$value['swatch' . $storeId] = isset($swatchStoreValue[$optionId]) ?
94-
$this->escapeHtml($swatchStoreValue[$optionId]) : '';
93+
$value['store' . $storeId] = isset($storeValues[$optionId]) ? $storeValues[$optionId] : '';
94+
$value['swatch' . $storeId] = isset($swatchStoreValue[$optionId]) ? $swatchStoreValue[$optionId] : '';
9595

9696
return $value;
9797
}

app/code/Magento/Swatches/Block/Adminhtml/Attribute/Edit/Options/Visual.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ class Visual extends AbstractSwatch
1919
/**
2020
* Create store values
2121
*
22-
* @codeCoverageIgnore
22+
* Method not intended to escape HTML entities
23+
* Escaping will be applied in template files
24+
*
2325
* @param integer $storeId
2426
* @param integer $optionId
2527
* @return array
@@ -38,16 +40,16 @@ protected function createStoreValues($storeId, $optionId)
3840
}
3941

4042
if (isset($storeValues[$optionId])) {
41-
$value['store' . $storeId] = $this->escapeHtml($storeValues[$optionId]);
43+
$value['store' . $storeId] = $storeValues[$optionId];
4244
}
4345

4446
if (isset($swatchStoreValue[$optionId])) {
45-
$value['defaultswatch' . $storeId] = $this->escapeHtml($swatchStoreValue[$optionId]);
47+
$value['defaultswatch' . $storeId] = $swatchStoreValue[$optionId];
4648
}
4749

4850
$swatchStoreValue = $this->reformatSwatchLabels($swatchStoreValue);
4951
if (isset($swatchStoreValue[$optionId])) {
50-
$value['swatch' . $storeId] = $this->escapeHtml($swatchStoreValue[$optionId]);
52+
$value['swatch' . $storeId] = $swatchStoreValue[$optionId];
5153
}
5254

5355
return $value;

0 commit comments

Comments
 (0)