Skip to content

Commit 0041c43

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
- CR changes
1 parent 1700f7c commit 0041c43

File tree

2 files changed

+3
-12
lines changed

2 files changed

+3
-12
lines changed

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

Lines changed: 1 addition & 12 deletions
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] = $this->prepareMetaTagContent($content);
219+
$this->metadata[$name] = htmlentities($content);
220220
}
221221

222222
/**
@@ -338,17 +338,6 @@ 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-
352341
/**
353342
* Retrieve content for keywords tag
354343
*

lib/internal/Magento/Framework/View/Test/Unit/Page/ConfigTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,10 @@ public function testMetadata()
133133
'keywords' => null,
134134
'robots' => null,
135135
'name' => 'test_value',
136+
'html_encoded' => '<title><span class="test">Test</span></title>',
136137
];
137138
$this->model->setMetadata('name', 'test_value');
139+
$this->model->setMetadata('html_encoded', '<title><span class="test">Test</span></title>');
138140
$this->assertEquals($expectedMetadata, $this->model->getMetadata());
139141
}
140142

0 commit comments

Comments
 (0)