mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-11 06:22:20 +09:00
Merge pull request #1289 from kijin/fix/content-encoding
DisplayHandler 실행 전에 뭔가가 출력될 경우 gzip 인코딩 오류 수정
This commit is contained in:
commit
330b6c502d
1 changed files with 8 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue