Skip to content

Commit 2a48abe

Browse files
committed
magento2/issues/12087: Changes for Adminhtml Widget Options class.
1 parent 7f0f260 commit 2a48abe

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

app/code/Magento/Widget/Block/Adminhtml/Widget/Options.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,10 @@ protected function _addField($parameter)
158158
$data['value'] = $parameter->getValue();
159159
}
160160

161+
if ($parameter->getType() == 'text' && $data['value'] != '') {
162+
$data['value'] = $this->_widget->decodeReservedChars($data['value']);
163+
}
164+
161165
//prepare unique id value
162166
if ($fieldName == 'unique_id' && $data['value'] == '') {
163167
$data['value'] = hash('sha256', microtime(1));

app/code/Magento/Widget/Model/Widget.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,24 @@ private function encodeReservedChars($string)
477477
);
478478
}
479479

480+
/**
481+
* @param $string
482+
* @return array
483+
*/
484+
public function decodeReservedChars($string)
485+
{
486+
$map = [
487+
'{' => urlencode('{'),
488+
'}' => urlencode('}')
489+
];
490+
491+
return str_replace(
492+
array_values($map),
493+
array_keys($map),
494+
$string
495+
);
496+
}
497+
480498
/**
481499
* @param $widget
482500
* @param $name

0 commit comments

Comments
 (0)