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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: hightman at twomice dot net
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 30 17:01:29 2024 UTC