diff --git a/typo3/sysext/extbase/Classes/Core/Bootstrap.php b/typo3/sysext/extbase/Classes/Core/Bootstrap.php index b3c1385ca09f0a4c84f801a932bf6536281ee136..af16aadb8ef6e2e71bd60c4c6701669f792422d6 100644 --- a/typo3/sysext/extbase/Classes/Core/Bootstrap.php +++ b/typo3/sysext/extbase/Classes/Core/Bootstrap.php @@ -164,10 +164,9 @@ class Bootstrap if (($typoScriptFrontendController = ($GLOBALS['TSFE'] ?? null)) instanceof TypoScriptFrontendController && $response->hasHeader('Content-Type') ) { - [$contentType] = explode(';', $response->getHeaderLine('Content-Type')); + $typoScriptFrontendController->setContentType($response->getHeaderLine('Content-Type')); // Do not send the header directly (see below) $response = $response->withoutHeader('Content-Type'); - $typoScriptFrontendController->setContentType($contentType); } if (headers_sent() === false) { diff --git a/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php b/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php index 6cd1e8708c4da63837ec837d44c429e76ce2f417..b6ae6c8dcdf15cfdc3e9870df20527e90937b745 100644 --- a/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php +++ b/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php @@ -469,7 +469,7 @@ class TypoScriptFrontendController implements LoggerAwareInterface * @todo Ticket: #63642 Should be refactored to a request/response model later * @internal Should only be used by TYPO3 core for now */ - protected string $contentType = 'text/html'; + protected string $contentType = 'text/html; charset=utf-8'; /** * Doctype to use @@ -2327,8 +2327,7 @@ class TypoScriptFrontendController implements LoggerAwareInterface */ public function applyHttpHeadersToResponse(ResponseInterface $response): ResponseInterface { - // Set header for content-type + charset-encoding - $response = $response->withHeader('Content-Type', $this->contentType . '; charset=utf-8'); + $response = $response->withHeader('Content-Type', $this->contentType); // Set header for content language unless disabled $contentLanguage = (string)$this->language->getLocale(); if (empty($this->config['config']['disableLanguageHeader'])) {