Skip to content

Commit 1700f7c

Browse files
committed
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
1 parent a4dd876 commit 1700f7c

File tree

1 file changed

+12
-1
lines changed
  • lib/internal/Magento/Framework/View/Page

1 file changed

+12
-1
lines changed

lib/internal/Magento/Framework/View/Page/Config.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ public function getTitle()
216216
public function setMetadata($name, $content)
217217
{
218218
$this->build();
219-
$this->metadata[$name] = $content;
219+
$this->metadata[$name] = $this->prepareMetaTagContent($content);
220220
}
221221

222222
/**
@@ -338,6 +338,17 @@ public function setKeywords($keywords)
338338
$this->setMetadata('keywords', $keywords);
339339
}
340340

341+
/**
342+
* Prepare content for meta tag attribute
343+
*
344+
* @param $content
345+
* @return string
346+
*/
347+
protected function prepareMetaTagContent($content)
348+
{
349+
return htmlentities($content);
350+
}
351+
341352
/**
342353
* Retrieve content for keywords tag
343354
*

0 commit comments

Comments
 (0)