php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34864 HEAD request causes more than one output buffer not to pass on it's contents
Submitted: 2005-10-14 03:37 UTC Modified: 2005-11-10 01:00 UTC
Votes:2
Avg. Score:4.5 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: famtj at yahoo dot com Assigned:
Status: No Feedback Package: Output Control
PHP Version: 4.4.0 OS: Unix
Private report: No CVE-ID: None
 [2005-10-14 03:37 UTC] famtj at yahoo dot com
Description:
------------
When more than one output buffers are chained together, and the client requests the page via HEAD, the inner-most output buffer won't pass on the buffer contents to the next buffer after modifying its code.  It seems to send a null string. It works fine with a PUT request.

Reproduce code:
---------------
<?php 
function contentLength($html)
{
	header('Content-Length: ' . strlen($html));
	return ($html);
}
ob_start("contentLength");
function fix_code($buffer)
{
	return(str_replace(" />", ">", $buffer));
}
ob_start("fix_code");
?>
<html><head>
<title>Bug</title>
</head><body>
<p>there is a bug</p>
</body></html>

Expected result:
----------------
HTTP/1.1 200 OK
Date: Fri, 14 Oct 2005 01:30:04 GMT
Server: Apache/1.3.33 (Unix) PHP/4.4.0 mod_ssl/2.8.24 OpenSSL/0.9.7a mod_perl/1.29 FrontPage/5.0.2.2635
X-Powered-By: PHP/4.4.0
Content-Length: 82
Connection: close
Content-Type: text/html

Actual result:
--------------
HTTP/1.1 200 OK
Date: Fri, 14 Oct 2005 01:29:20 GMT
Server: Apache/1.3.33 (Unix) PHP/4.4.0 mod_ssl/2.8.24 OpenSSL/0.9.7a mod_perl/1.29 FrontPage/5.0.2.2635
X-Powered-By: PHP/4.4.0
Content-Length: 0
Connection: close
Content-Type: text/html

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-11-02 14:22 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip


 [2005-11-10 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 16:01:28 2024 UTC