php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40055 ob_gzhandler do not work correctly for register_shutdown_function
Submitted: 2007-01-08 02:00 UTC Modified: 2007-01-11 10:06 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: hightman at twomice dot net Assigned:
Status: Wont fix Package: Output Control
PHP Version: 4.4.4 OS: Linux/FreeBSD
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
23 + 9 = ?
Subscribe to this entry?

 
 [2007-01-08 02:00 UTC] hightman at twomice dot net
Description:
------------
If there are some outputs on the functions called by `register_shutdown_function`, the `ob_gzhandler` do not work correctly for these outputs messages. In other words, these messages have not been compressed with the other outpus msg.

It is serious problem for the Web Browsers, because they will get the error check sum of contents, so the page content can't not be display fullly.

Reproduce code:
---------------
<?php
function foo()
{
  echo "Hello, foo bar before process quit!\n";
}

ob_start('ob_gzhandler');
register_shutdown_function('foo');
echo "Normal output\n";
?>

Expected result:
----------------
The output of function `foo` will be added to all output msg and compressed by ob_gzhandler

Actual result:
--------------
"Normal output\n" were compressed, and the ouput of `foo()` never been compressed.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-01-11 10:06 UTC] tony2001@php.net
In PHP4 shutdown functions are called after flushing the output buffers, but in PHP5 this behaviour is different.
We do not plan to introduce any changes in PHP4 except for critical bugfixes.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Fri Dec 04 05:01:23 2020 UTC