mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Reverted regression with ob_clean() called even when ob_start() was not
executed, introduced in cb3100f71f
Refs #864. Fixes #882
This commit is contained in:
parent
17a7a96ba2
commit
f9de88d6cf
1 changed files with 6 additions and 3 deletions
|
@ -615,7 +615,8 @@ class Dispatcher extends Object {
|
|||
*/
|
||||
function _deliverAsset($assetFile, $ext) {
|
||||
$ob = @ini_get("zlib.output_compression") !== '1' && extension_loaded("zlib") && (strpos(env('HTTP_ACCEPT_ENCODING'), 'gzip') !== false);
|
||||
if ($ob && Configure::read('Asset.compress')) {
|
||||
$compressionEnabled = $ob && Configure::read('Asset.compress');
|
||||
if ($compressionEnabled) {
|
||||
ob_start();
|
||||
ob_start('ob_gzhandler');
|
||||
}
|
||||
|
@ -642,11 +643,13 @@ class Dispatcher extends Object {
|
|||
if ($ext === 'css' || $ext === 'js') {
|
||||
include($assetFile);
|
||||
} else {
|
||||
if ($compressionEnabled) {
|
||||
ob_clean();
|
||||
}
|
||||
readfile($assetFile);
|
||||
}
|
||||
|
||||
if (Configure::read('Asset.compress')) {
|
||||
if ($compressionEnabled) {
|
||||
ob_end_flush();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue