|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-11-02 14:22 UTC] sniper@php.net
[2005-11-10 01:00 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 16:00:02 2025 UTC |
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