|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2005-08-19 13:41 UTC] mike@php.net
Description: ------------ ob_gzhandler does not always append a trailing NUL byte to the deflated string, resulting in warnings in debug mode. PATCH: http://dev.iworks.at/PATCHES/ob_gzhandler_trailing_NUL.txt PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 13:00:02 2025 UTC |
Reproducing script: <?php function f() { $data = ob_get_contents(); while(@ob_end_clean()); ob_start('ob_gzhandler'); $step = strlen($data)/2; echo substr($data, 0, $step); ob_flush(); echo substr($data, $step); } register_shutdown_function('f'); ob_start(); echo '<pre>'; readfile(__FILE__); ?>Sorry, this bug is not entirely fixed. Reproducing Script: Similar to the previous one, but with an additional ob_end_clean() <?php function f() { $data = ob_get_contents(); while(@ob_end_clean()); ob_start('ob_gzhandler'); $step = strlen($data)/2; echo substr($data, 0, $step); ob_flush(); echo substr($data, $step); } register_shutdown_function('f'); while(@ob_end_clean()); ob_start(); echo '<pre>'; readfile(__FILE__); ?>