|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-03-29 06:09 UTC] yohgaki@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 04:00:01 2025 UTC |
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. <?php ob_start('ob_gzhandler'); echo "foo"; ob_clean(); 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: /src/cvs/php4-head/Zend/zend_execute_API.c:274) 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 it: X-Powered-By: PHP/4.3.0-dev Content-Encoding: gzip Vary: Accept-Encoding Connection: close Transfer-Encoding: chunked Content-Type: text/html d4 <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 /> barbarbar 0 for now i'm working around this by using a logic like this, proving that ob_clean works, but not with ob_gzhandler. <?php ob_start(); echo "foo"; ob_clean(); echo "barbarbar"; $b = ob_get_contents(); ob_end_clean(); ob_start('ob_gzhandler'); print $b; ?> regards, -lukas ~