From: Operating system: n/a PHP version: 5.3.8 Package: Output Control Bug Type: Bug Bug description:ob_gzhandler and ob_clean
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 bug report at https://bugs.php.net/bug.php?id=60041&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=60041&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=60041&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=60041&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=60041&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=60041&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=60041&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=60041&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=60041&r=needscript Try newer version: https://bugs.php.net/fix.php?id=60041&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=60041&r=support Expected behavior: https://bugs.php.net/fix.php?id=60041&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=60041&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=60041&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=60041&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=60041&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=60041&r=dst IIS Stability: https://bugs.php.net/fix.php?id=60041&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=60041&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=60041&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=60041&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=60041&r=mysqlcfg