diff --git a/lib/internal/Magento/Framework/View/Page/Config.php b/lib/internal/Magento/Framework/View/Page/Config.php index 7dd942978ecbe..66e2843ce97a8 100644 --- a/lib/internal/Magento/Framework/View/Page/Config.php +++ b/lib/internal/Magento/Framework/View/Page/Config.php @@ -117,6 +117,7 @@ class Config 'description' => null, 'keywords' => null, 'robots' => null, + 'title' => null, ]; /** diff --git a/lib/internal/Magento/Framework/View/Page/Config/Renderer.php b/lib/internal/Magento/Framework/View/Page/Config/Renderer.php index cdf857f645a0b..cfe249d339e34 100644 --- a/lib/internal/Magento/Framework/View/Page/Config/Renderer.php +++ b/lib/internal/Magento/Framework/View/Page/Config/Renderer.php @@ -136,6 +136,12 @@ public function renderMetadata() protected function processMetadataContent($name, $content) { $method = 'get' . $this->string->upperCaseWords($name, '_', ''); + if ($name === 'title') { + if (!$content) { + $content = $this->escaper->escapeHtml($this->pageConfig->$method()->get()); + } + return $content; + } if (method_exists($this->pageConfig, $method)) { $content = $this->pageConfig->$method(); } diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Page/ConfigTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Page/ConfigTest.php index 4862816a9efe6..f6d240443a942 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Page/ConfigTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Page/ConfigTest.php @@ -13,7 +13,7 @@ use Magento\Framework\View\Page\Config; /** - * @covers Magento\Framework\View\Page\Config + * @covers \Magento\Framework\View\Page\Config * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ @@ -137,6 +137,7 @@ public function testMetadata() 'description' => null, 'keywords' => null, 'robots' => null, + 'title' => null, 'name' => 'test_value', 'html_encoded' => '<title><span class="test">Test</span></title>', ];