X-Git-Url: http://git.typo3.org/Packages/TYPO3.CMS.git/blobdiff_plain/1b93464c68d398351410d871826e30066bfdbb2f..8a811b6e3fcb76256888cb83409cf56a4a0b7191:/typo3/sysext/frontend/Classes/Page/PageGenerator.php?ds=sidebyside diff --git a/typo3/sysext/frontend/Classes/Page/PageGenerator.php b/typo3/sysext/frontend/Classes/Page/PageGenerator.php index 0a776a342f2..0bc5d659b1a 100644 --- a/typo3/sysext/frontend/Classes/Page/PageGenerator.php +++ b/typo3/sysext/frontend/Classes/Page/PageGenerator.php @@ -223,10 +223,22 @@ class PageGenerator $pageRenderer->setXmlPrologAndDocType(implode(LF, $docTypeParts)); } // Begin header section: - if (($tsfe->config['config']['htmlTag_setParams'] ?? '') !== 'none') { - $_attr = $tsfe->config['config']['htmlTag_setParams'] ?? GeneralUtility::implodeAttributes($htmlTagAttributes); - } else { + if (is_array($tsfe->config['config']['htmlTag.']['attributes.'] ?? null)) { $_attr = ''; + foreach ($tsfe->config['config']['htmlTag.']['attributes.'] as $attributeName => $value) { + $_attr .= ' ' . htmlspecialchars($attributeName) . ($value !== '' ? '="' . htmlspecialchars((string)$value) . '"' : ''); + // If e.g. "htmlTag.attributes.dir" is set, make sure it is not added again with "implodeAttributes()" + if (isset($htmlTagAttributes[$attributeName])) { + unset($htmlTagAttributes[$attributeName]); + } + } + $_attr = GeneralUtility::implodeAttributes($htmlTagAttributes) . $_attr; + } elseif (($tsfe->config['config']['htmlTag_setParams'] ?? '') === 'none') { + $_attr = ''; + } elseif (isset($tsfe->config['config']['htmlTag_setParams'])) { + $_attr = $tsfe->config['config']['htmlTag_setParams']; + } else { + $_attr = GeneralUtility::implodeAttributes($htmlTagAttributes); } $htmlTag = ''; if (isset($tsfe->config['config']['htmlTag_stdWrap.'])) {