diff --git a/lib/internal/Magento/Framework/View/Page/Config.php b/lib/internal/Magento/Framework/View/Page/Config.php index 1ff41f5becfff..93467aa8469fe 100644 --- a/lib/internal/Magento/Framework/View/Page/Config.php +++ b/lib/internal/Magento/Framework/View/Page/Config.php @@ -216,7 +216,7 @@ public function getTitle() public function setMetadata($name, $content) { $this->build(); - $this->metadata[$name] = $content; + $this->metadata[$name] = $this->prepareMetaTagContent($content); } /** @@ -338,6 +338,17 @@ public function setKeywords($keywords) $this->setMetadata('keywords', $keywords); } + /** + * Prepare content for meta tag attribute + * + * @param $content + * @return string + */ + protected function prepareMetaTagContent($content) + { + return htmlentities($content); + } + /** * Retrieve content for keywords tag *