Edit report at https://bugs.php.net/bug.php?id=60041&edit=1
ID: 60041 Updated by: [email protected] Reported by: jille at hexon dot cx Summary: ob_gzhandler and ob_clean -Status: Open +Status: Assigned Type: Bug Package: Output Control Operating System: n/a PHP Version: 5.3.8 -Assigned To: +Assigned To: mike Block user comment: N Private report: N Previous Comments: ------------------------------------------------------------------------ [2011-10-11 14:42:29] jille at hexon dot cx Description: ------------ Calling ob_clean() after starting the ob_gzhandler screws up. ob_get_clean() doesn't seem to behave perfectly either. There seem to be two problems: * The gzip headers gets lost or is incorrect. * The Content-Encoding header can be set even if the data is not gzip'ed (See test script 2) Test script: --------------- <?php ob_start('ob_gzhandler'); // Do anything, doesn't matter whether you output anything or give an empty response. ob_clean(); ?> or <?php ob_start('ob_gzhandler'); echo "Hello world."; print ob_get_clean(); ?> Expected result: ---------------- HTTP/1.1 200 OK Date: Tue, 11 Oct 2011 14:32:12 GMT Server: Apache Content-Encoding: gzip Vary: Accept-Encoding Content-Length: 0 Connection: close Content-Type: text/html; charset=utf-8 Connection closed by foreign host. Actual result: -------------- HTTP/1.1 200 OK Date: Tue, 11 Oct 2011 14:32:12 GMT Server: Apache Content-Encoding: gzip Vary: Accept-Encoding Content-Length: 0 Connection: close Content-Type: text/html; charset=utf-8 [some data] Connection closed by foreign host. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=60041&edit=1
