Skip to content

Commit 89acc58

Browse files
committed
fix(config): recognize disabled zlib compression values
- accept Off as a disabled zlib.output_compression value - keep the zlib output-buffer guard active for enabled values - update the 4.7.3 changelog Signed-off-by: memleakd <121398829+memleakd@users.noreply.github.com>
1 parent b8665b9 commit 89acc58

3 files changed

Lines changed: 3 additions & 4 deletions

File tree

app/Config/Events.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
Events::on('pre_system', static function (): void {
2727
if (ENVIRONMENT !== 'testing') {
28-
if (ini_get('zlib.output_compression')) {
28+
if (! in_array(strtolower((string) ini_get('zlib.output_compression')), ['', '0', 'off'], true)) {
2929
throw FrameworkException::forEnabledZlibOutputCompression();
3030
}
3131

system/HotReloader/HotReloader.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ public function run(): void
2424
session_write_close();
2525
}
2626

27-
// Use "0" because ini_get() returns "Off" as a truthy string at runtime.
28-
ini_set('zlib.output_compression', '0');
27+
ini_set('zlib.output_compression', 'Off');
2928

3029
header('Cache-Control: no-store');
3130
header('Content-Type: text/event-stream');

user_guide_src/source/changelogs/v4.7.3.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Bugs Fixed
4545
- **Database:** Fixed a bug where ``BaseConnection::listTables()`` could return a sparse array when using cached table names after a table was dropped.
4646
- **Database:** Fixed a bug where the PostgreSQL driver's ``increment()`` and ``decrement()`` methods were not working for numeric columns.
4747
- **Database:** Fixed a bug where the SQLSRV driver's decrement method was adding instead of subtracting the decrement value when ``$castTextToInt`` was false.
48-
- **HotReloader:** Fixed a bug where disabling ``zlib.output_compression`` could leave a truthy ``Off`` runtime value that caused later requests in long-running workers to fail the output-buffer guard.
48+
- **Config:** Fixed a bug where the app starter's ``zlib.output_compression`` guard rejected the valid disabled value ``Off``.
4949
- **Kint:** Fixed a bug where stale Content Security Policy nonces were reused in worker mode, causing browser CSP violations for Debug Toolbar assets.
5050
- **Language:** Fixed a bug where ``Language::getLine()`` returned the literal dot-notation key instead of the nested array value when the requested key resolved to an intermediate array three or more levels deep.
5151
- **Toolbar:** Fixed a bug where the Logs collector raised an undefined property error when using a third-party PSR-3 logger.

0 commit comments

Comments
 (0)