Skip to content

Commit ad3a1ce

Browse files
author
Valeriy Nayda
committed
MAGETWO-63858: Certain ASCII Attribute Values gets transformed to HTML code in attributes
1 parent 13ec629 commit ad3a1ce

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
@@ -18,7 +18,9 @@ class Visual extends AbstractSwatch
1818
/**
1919
* Create store values
2020
*
21-
* @codeCoverageIgnore
21+
* Method not intended to escape HTML entities
22+
* Escaping will be applied in template files
23+
*
2224
* @param integer $storeId
2325
* @param integer $optionId
2426
* @return array
@@ -37,16 +39,16 @@ protected function createStoreValues($storeId, $optionId)
3739
}
3840

3941
if (isset($storeValues[$optionId])) {
40-
$value['store' . $storeId] = $this->escapeHtml($storeValues[$optionId]);
42+
$value['store' . $storeId] = $storeValues[$optionId];
4143
}
4244

4345
if (isset($swatchStoreValue[$optionId])) {
44-
$value['defaultswatch' . $storeId] = $this->escapeHtml($swatchStoreValue[$optionId]);
46+
$value['defaultswatch' . $storeId] = $swatchStoreValue[$optionId];
4547
}
4648

4749
$swatchStoreValue = $this->reformatSwatchLabels($swatchStoreValue);
4850
if (isset($swatchStoreValue[$optionId])) {
49-
$value['swatch' . $storeId] = $this->escapeHtml($swatchStoreValue[$optionId]);
51+
$value['swatch' . $storeId] = $swatchStoreValue[$optionId];
5052
}
5153

5254
return $value;

0 commit comments

Comments
 (0)