From 1700f7c58d6464349ca1a236823e30d4ef0ef01e Mon Sep 17 00:00:00 2001 From: Roman Ganin Date: Thu, 21 Apr 2016 13:50:59 +0300 Subject: [PATCH] MAGETWO-48511: [GitHub] HTML tags inside the Meta Description on Edit Product Admin page brake the Storefront PDP layout #1514 #2613 #3090 #3244 #3255 #3813 #4031 #4073 --- lib/internal/Magento/Framework/View/Page/Config.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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 *