diff --git a/app/code/Magento/Widget/Block/Adminhtml/Widget/Options.php b/app/code/Magento/Widget/Block/Adminhtml/Widget/Options.php index 32bae10c801c8..87ae52b2eadda 100644 --- a/app/code/Magento/Widget/Block/Adminhtml/Widget/Options.php +++ b/app/code/Magento/Widget/Block/Adminhtml/Widget/Options.php @@ -158,6 +158,10 @@ protected function _addField($parameter) $data['value'] = $parameter->getValue(); } + if ($parameter->getType() == 'text' && $data['value'] != '') { + $data['value'] = $this->_widget->decodeReservedChars($data['value']); + } + //prepare unique id value if ($fieldName == 'unique_id' && $data['value'] == '') { $data['value'] = hash('sha256', microtime(1)); diff --git a/app/code/Magento/Widget/Model/Widget.php b/app/code/Magento/Widget/Model/Widget.php index bb6c0f22fefdf..12af534325224 100644 --- a/app/code/Magento/Widget/Model/Widget.php +++ b/app/code/Magento/Widget/Model/Widget.php @@ -477,6 +477,24 @@ private function encodeReservedChars($string) ); } + /** + * @param $string + * @return array + */ + public function decodeReservedChars($string) + { + $map = [ + '{' => urlencode('{'), + '}' => urlencode('}') + ]; + + return str_replace( + array_values($map), + array_keys($map), + $string + ); + } + /** * @param $widget * @param $name