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