|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #16341 mysql and header() problem prevent saving session vars(?)
Submitted: 2002-03-29 04:12 UTC Modified: 2002-03-29 06:09 UTC
From: lukas at edeal dot de Assigned:
Status: Closed Package: Output Control
PHP Version: 4.1.1 OS: Linux (Debian)
Private report: No CVE-ID: None
 [2002-03-29 04:12 UTC] lukas at edeal dot de
this bug-report really is for latest CVS-HEAD as of 2002-03-29.

using this script with latest cvs the output appears incorrect to me, b/c "barbarbar" is not encoded.
if you remove ob_clean() everything is encoded just fine.


echo "foo";
echo "barbarbar";


upon request this is logged to error_log:

PHP Warning:  String is not zero-terminated (~) (source:
/src/cvs/php4-head/Zend/zend_execute_API.c:274) in /public_html/test/ob/test3.php on line 5 

/public_html/test/ob/test3.php(5) : Warning - String is not zero-terminated (~) (source:

using ob_gzhandler i quite expect a binary non zero-terminated string and this warning is not a surprise. but i am surprised about it being issued on ob_clean(); which, simplified, is just a reset doing 
text_length=0 on the active output buffers. it doesn't really have to touch and use the buffers to do that, does it?

the above script sends the following response including content-encoding: gzip, but without actually encoding

X-Powered-By: PHP/4.3.0-dev
Content-Encoding: gzip
Vary: Accept-Encoding
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html

<br />
<b>Warning</b>:  String is not zero-terminated (~) (source:
    /src/cvs/php4-head/Zend/zend_execute_API.c:274) in
<b>/public_html/test/ob/test3.php</b> on line <b>5</b><br />

for now i'm working around this by using a logic like this, proving that ob_clean works, but not with ob_gzhandler.

echo "foo";
echo "barbarbar";

$b = ob_get_contents();

print $b;



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-03-29 06:09 UTC]
This bug is fixed in HEAD.
Fix is included in PHP 4.2.0.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sun Oct 01 13:01:24 2023 UTC