Issue Bug Closed

#106449`getJavaScriptFileType` returns non-empty @ DocType HTML5

Marcus Förster 03/27/25, 20:44 updated 08/12/25, 14:36

Description

https://github.com/TYPO3/typo3/blob/8ea3bc234174417e0e4d5465c69af631a28a8097/typo3/sysext/core/Classes/Resource/ResourceCompressor.php#L680

var_dump($GLOBALS[‘TSFE’]->config[‘config’][‘doctype’]) => string(0) “”

PATCH via https://git.typo3.org/typo3/typo3/-/commit/4a61b1dca6611a40ad5acc95f86cc30b89b7bce7

— OR —less pref…
--- NOT REAL PATCH
+++ typo3/cms-core/Classes/Resource/ResourceCompressor.php    2025-03-27 21:36:13.443472535 +0100
@@ -689,7 +689,7 @@
     {
         if (!isset($GLOBALS['TSFE'])
             || !($GLOBALS['TSFE'] instanceof TypoScriptFrontendController)
+            || empty($GLOBALS['TSFE']->config['config']['doctype'])
+            || ($GLOBALS['TSFE']->config['config']['doctype'] === 'html5')
-            || ($GLOBALS['TSFE']->config['config']['doctype'] ?? 'html5') === 'html5'
         ) {
             // no TSFE, or doctype set to html5
             return '';

Reviews 1