[BUGFIX] Do not compress inline CSS 84/63884/2
authorSusanne Moog <look@susi.dev>
Mon, 23 Mar 2020 20:06:36 +0000 (21:06 +0100)
committerAndreas Fernandez <a.fernandez@scripting-base.de>
Tue, 24 Mar 2020 06:02:18 +0000 (07:02 +0100)
Gzip encoding inline CSS does not work and we should not do that.
Therefor setting `inline = 1` now also implies `disableCompression`
(same way as it is done for concatenation).

Resolves: #90820
Releases: master, 9.5
Change-Id: I85c70bba9dd850fe9b03086dc6c51f7064c60ba7
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/63884
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Timo Poppinga <timo.poppinga@zdrei.com>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Timo Poppinga <timo.poppinga@zdrei.com>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
typo3/sysext/frontend/Classes/Http/RequestHandler.php

index f103cd2..7dd8d47 100644 (file)
@@ -458,7 +458,7 @@ class RequestHandler implements RequestHandlerInterface
                                 $cssFileConfig['alternate'] ? 'alternate stylesheet' : 'stylesheet',
                                 $cssFileConfig['media'] ?: 'all',
                                 $cssFileConfig['title'] ?: '',
-                                $cssFileConfig['external'] ? false : empty($cssFileConfig['disableCompression']),
+                                $cssFileConfig['external']  || (bool)$cssFileConfig['inline'] ? false : empty($cssFileConfig['disableCompression']),
                                 (bool)$cssFileConfig['forceOnTop'],
                                 $cssFileConfig['allWrap'],
                                 (bool)$cssFileConfig['excludeFromConcatenation'] || (bool)$cssFileConfig['inline'],
@@ -501,7 +501,7 @@ class RequestHandler implements RequestHandlerInterface
                                 $cssFileConfig['alternate'] ? 'alternate stylesheet' : 'stylesheet',
                                 $cssFileConfig['media'] ?: 'all',
                                 $cssFileConfig['title'] ?: '',
-                                $cssFileConfig['external'] ? false : empty($cssFileConfig['disableCompression']),
+                                $cssFileConfig['external'] || (bool)$cssFileConfig['inline'] ? false : empty($cssFileConfig['disableCompression']),
                                 (bool)$cssFileConfig['forceOnTop'],
                                 $cssFileConfig['allWrap'],
                                 (bool)$cssFileConfig['excludeFromConcatenation'] || (bool)$cssFileConfig['inline'],