mirror of
https://github.com/getgrav/grav.git
synced 2025-02-20 19:56:53 +01:00
Better fix for system.cache.gzip: true
This commit is contained in:
parent
8f0443a73d
commit
c9c23c6c4f
|
|
@ -12,7 +12,7 @@
|
|||
- `text`, `url`, `hidden`, `commalist`: 2048
|
||||
- `text` (multiline), `textarea`: 65536
|
||||
3. [](#bugfix)
|
||||
* Fixed issue with `system.cache.gzip: true` resulted in admin "Fetch Failed" for PHP 8.0+
|
||||
* Fixed issue with `system.cache.gzip: true` resulted in admin "Fetch Failed" for PHP 8.0.17 and PHP 8.1.4 [PHP bug #8218](https://github.com/php/php-src/issues/8218).
|
||||
* Fix for multi-lang issues with Security Report
|
||||
|
||||
# v1.7.31
|
||||
|
|
|
|||
|
|
@ -43,4 +43,25 @@ class SystemFacade extends \Whoops\Util\SystemFacade
|
|||
$handler();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $httpCode
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function setHttpResponseCode($httpCode)
|
||||
{
|
||||
if (!headers_sent()) {
|
||||
// Ensure that no 'location' header is present as otherwise this
|
||||
// will override the HTTP code being set here, and mask the
|
||||
// expected error page.
|
||||
header_remove('location');
|
||||
|
||||
// Work around PHP bug #8218 (8.0.17 & 8.1.4).
|
||||
header_remove('Content-Encoding');
|
||||
}
|
||||
|
||||
return http_response_code($httpCode);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -350,14 +350,12 @@ class Grav extends Container
|
|||
*/
|
||||
public function cleanOutputBuffers(): void
|
||||
{
|
||||
/** @var Config $config */
|
||||
$config = $this['config'];
|
||||
$gzip_enabled = (int) $config->get('system.cache.gzip');
|
||||
|
||||
// Make sure nothing extra gets written to the response.
|
||||
while (ob_get_level() > 2 + $gzip_enabled) {
|
||||
while (ob_get_level()) {
|
||||
ob_end_clean();
|
||||
}
|
||||
// Work around PHP bug #8218 (8.0.17 & 8.1.4).
|
||||
header_remove('Content-Encoding');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user