Skip to content
Permalink
Browse files

Reverted regression with ob_clean() called even when ob_start() was not

executed, introduced in cb3100f Refs #864.  Fixes #882
  • Loading branch information...
markstory committed Jul 3, 2010
1 parent 17a7a96 commit f9de88d6cfdb42ca0541daafd4c9ebbc59212659
Showing with 6 additions and 3 deletions.
  1. +6 −3 cake/dispatcher.php
@@ -615,7 +615,8 @@ function asset($url) {
*/
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 @@ function _deliverAsset($assetFile, $ext) {
if ($ext === 'css' || $ext === 'js') {
include($assetFile);
} else {
ob_clean();
if ($compressionEnabled) {
ob_clean();
}
readfile($assetFile);
}
if (Configure::read('Asset.compress')) {
if ($compressionEnabled) {
ob_end_flush();
}
}

0 comments on commit f9de88d

Please sign in to comment.
You can’t perform that action at this time.