Skip to content

Commit fbcfcae

Browse files
committed
[BUGFIX] Ensure output compression handler is only initialized once
The middleware `SudoModeInterceptor::handleRequestGrantedException()` invokes `TYPO3\CMS\Core\Http\Application` again when picking up the previous HTTP non-GET request. This triggers the initialization of the `OutputCompression` middleware again, causing a PHP warning concerning the active `ob_gzhandler`. Resolves: #106785 Releases: main, 13.4, 12.4 Change-Id: I4928a81f3e60a35f18dcaee6112feaf36600a36c Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/91321 Reviewed-by: Sebastian Iffland <sebastian.iffland@fullhaus.de> Reviewed-by: Oliver Hader <oliver.hader@typo3.org> Tested-by: Markus Klein <markus.klein@typo3.org> Tested-by: Christian Kuhn <lolli@schwarzbu.ch> Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch> Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de> Tested-by: core-ci <typo3@b13.com> Reviewed-by: Markus Klein <markus.klein@typo3.org> Reviewed-by: Mathias Brodala <mbrodala@pagemachine.de> Tested-by: Oliver Hader <oliver.hader@typo3.org>
1 parent 5700020 commit fbcfcae

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

typo3/sysext/backend/Classes/Middleware/OutputCompression.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ protected function initializeOutputCompression(): void
5252
if (MathUtility::canBeInterpretedAsInteger($GLOBALS['TYPO3_CONF_VARS']['BE']['compressionLevel'])) {
5353
@ini_set('zlib.output_compression_level', (string)$GLOBALS['TYPO3_CONF_VARS']['BE']['compressionLevel']);
5454
}
55-
ob_start('ob_gzhandler');
55+
if (!in_array('ob_gzhandler', ob_list_handlers(), true)) {
56+
ob_start('ob_gzhandler');
57+
}
5658
}
5759
}
5860
}

0 commit comments

Comments
 (0)