diff --git a/app/code/Magento/Backend/Block/Widget/Button.php b/app/code/Magento/Backend/Block/Widget/Button.php index 5929df1411b01168f60505db50e6b74a8452fa92..bc9deb2fd8be4543aaf9a8855bbbbd20ec106cb1 100644 --- a/app/code/Magento/Backend/Block/Widget/Button.php +++ b/app/code/Magento/Backend/Block/Widget/Button.php @@ -113,7 +113,7 @@ class Button extends \Magento\Backend\Block\Widget if ($attributeValue === null || $attributeValue == '') { continue; } - $html .= $attributeKey . '="' . $this->escapeHtml($attributeValue) . '" '; + $html .= $attributeKey . '="' . htmlspecialchars($attributeValue, ENT_COMPAT, 'UTF-8', false) . '" '; } return $html; diff --git a/app/code/Magento/Backend/Block/Widget/Button/SplitButton.php b/app/code/Magento/Backend/Block/Widget/Button/SplitButton.php index c8c739bad37efe56ba7490c87a1f6f9fb9ee194d..e2e83457a571c33cb2cf73ec62cdaa1338a3940a 100644 --- a/app/code/Magento/Backend/Block/Widget/Button/SplitButton.php +++ b/app/code/Magento/Backend/Block/Widget/Button/SplitButton.php @@ -229,7 +229,7 @@ class SplitButton extends \Magento\Backend\Block\Widget if ($attributeValue === null || $attributeValue == '') { continue; } - $html[] = $attributeKey . '="' . $this->escapeHtml($attributeValue) . '"'; + $html[] = $attributeKey . '="' . htmlspecialchars($attributeValue, ENT_COMPAT, 'UTF-8', false) . '"'; } return join(' ', $html); } diff --git a/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Action.php b/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Action.php index 4da88af83ca9b56293e5fa16f10dc18e2d0b5926..312a460118630b2040f496cf96d02a0535def703 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Action.php +++ b/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Action.php @@ -82,7 +82,9 @@ class Action extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\Text $actionCaption = ''; $this->_transformActionData($action, $actionCaption, $row); - $htmlAttributes = ['value' => $this->escapeHtml($this->_jsonEncoder->encode($action))]; + $htmlAttributes = [ + 'value' => htmlspecialchars($this->_jsonEncoder->encode($action), ENT_COMPAT, 'UTF-8', false) + ]; $actionAttributes->setData($htmlAttributes); return '<option ' . $actionAttributes->serialize() . '>' . $actionCaption . '</option>'; } diff --git a/app/code/Magento/Integration/Block/Adminhtml/Widget/Grid/Column/Renderer/Button.php b/app/code/Magento/Integration/Block/Adminhtml/Widget/Grid/Column/Renderer/Button.php index db4fa94630da9cafd8756697702d643b990781bb..200bf08f37a4574139a16aa7aa4f0ca44057524d 100644 --- a/app/code/Magento/Integration/Block/Adminhtml/Widget/Grid/Column/Renderer/Button.php +++ b/app/code/Magento/Integration/Block/Adminhtml/Widget/Grid/Column/Renderer/Button.php @@ -85,7 +85,10 @@ class Button extends AbstractRenderer ) : $this->getColumn()->{$rowMethodName}(); if ($attributeValue) { - $attributes[] = sprintf('%s="%s"', $attributeName, $this->escapeHtml($attributeValue)); + $attributes[] = sprintf( + '%s="%s"', + $attributeName, htmlspecialchars($attributeValue, ENT_COMPAT, 'UTF-8', false) + ); } } return $attributes; diff --git a/app/code/Magento/Integration/Block/Adminhtml/Widget/Grid/Column/Renderer/Link.php b/app/code/Magento/Integration/Block/Adminhtml/Widget/Grid/Column/Renderer/Link.php index 1289d8374693db31f691bdf1c508c3d7d066f544..b7613f54f90d461d96dedc943c5cd19b82ba50b9 100644 --- a/app/code/Magento/Integration/Block/Adminhtml/Widget/Grid/Column/Renderer/Link.php +++ b/app/code/Magento/Integration/Block/Adminhtml/Widget/Grid/Column/Renderer/Link.php @@ -118,7 +118,7 @@ class Link extends AbstractRenderer if ($value === null || $value == '') { continue; } - $html[] = sprintf('%s="%s"', $key, $this->escapeHtml($value)); + $html[] = sprintf('%s="%s"', $key, htmlspecialchars($value, ENT_COMPAT, 'UTF-8', false)); } return join(' ', $html); diff --git a/lib/internal/Magento/Framework/Url/RouteParamsResolver.php b/lib/internal/Magento/Framework/Url/RouteParamsResolver.php index 61dec6f4a18bdea24b03bbe83b3e6367abb74186..9d84307d28135a070569bad9e4b5c859d766a5a3 100644 --- a/lib/internal/Magento/Framework/Url/RouteParamsResolver.php +++ b/lib/internal/Magento/Framework/Url/RouteParamsResolver.php @@ -110,7 +110,11 @@ class RouteParamsResolver extends \Magento\Framework\DataObject implements Route if ($key == 'key') { $this->setRouteParam($key, $value); } else { - $this->setRouteParam($this->getEscaper()->escapeUrl($key), $this->getEscaper()->escapeUrl($value)); + if (is_object($value)) { + $this->setRouteParam($this->getEscaper()->escapeUrl($key), $value); + } else { + $this->setRouteParam($this->getEscaper()->escapeUrl($key), $this->getEscaper()->escapeUrl($value)); + } } }