Merge pull request #1289 from kijin/fix/content-encoding

DisplayHandler 실행 전에 뭔가가 출력될 경우 gzip 인코딩 오류 수정
This commit is contained in:
bnu 2015-03-23 17:30:52 +09:00
commit 330b6c502d

View file

@ -84,10 +84,6 @@ class DisplayHandler extends Handler
}
// header output
if($this->gz_enabled)
{
header("Content-Encoding: gzip");
}
$httpStatusCode = $oModule->getHttpStatusCode();
if($httpStatusCode && $httpStatusCode != 200)
@ -114,9 +110,17 @@ class DisplayHandler extends Handler
$this->content_size = strlen($output);
$output .= $this->_debugOutput();
// disable gzip if output already exists
ob_flush();
if(headers_sent())
{
$this->gz_enabled = FALSE;
}
// results directly output
if($this->gz_enabled)
{
header("Content-Encoding: gzip");
print ob_gzhandler($output, 5);
}
else