ID: 36525
User updated by: lunter at interia dot pl
Reported By: lunter at interia dot pl
Status: Bogus
Bug Type: Output Control
Operating System: winXP
PHP Version: 5.1.2
New Comment:
OK, I solved the proble. Corrent script:
<?
function a($i,$m){
$i=strtolower($i);
$m=ob_gzhandler($i,$m);
if($m!==false){$i=$m;}
return($i);
}
ob_start('a');
?>
PAGE CONTENTS
But there are two issues with documentation:
1. http://php.net/manual/en/function.ob-gzhandler.php
There is not written what ob-gzhandler return boolean false if browser
does't support gzip/deflate compression.
Without this sentence you may think that ob-gzhandler return
uncompressed input string.
2. http://php.net/manual/en/function.ob-start.php
There is not written what if ob_start output_callback is a callable
function and this function return boolean false, ob_start return
original buffer.
Previous Comments:
------------------------------------------------------------------------
[2006-02-25 21:05:19] lunter at interia dot pl
hmm, this is for me odd, becouse to ob_gzhandler input is put
strlower'ed string and:
output string ob_gzhandler ( input string )
1. when browser support gzip/deflate compression, ob_gzhandler return
compressed input and send headers - this is ok.
2. when browser does't support gzip/deflate compression,
ob_gzhandler should return input string wihtout compression...
But it return different string to input string! Why ??
Mike, what is wrong in my reason ?
------------------------------------------------------------------------
[2006-02-25 20:28:11] [EMAIL PROTECTED]
Because you call strtolower() on the string. The "a" output buffer
handler is run without regard whether browser supports gzip content
encoding.
------------------------------------------------------------------------
[2006-02-25 20:10:14] lunter at interia dot pl
mike, do you know why function a return lower case string when browser
does't support gzip/deflate compression ???
------------------------------------------------------------------------
[2006-02-25 16:10:59] [EMAIL PROTECTED]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php
------------------------------------------------------------------------
[2006-02-25 10:22:45] lunter at interia dot pl
Description:
------------
ob_gzhandler does't return $i parametr when browser does't support
gzip/deflate compression
Reproduce code:
---------------
<?
function a($i,$m){
$i=strtolower($i);
$i=ob_gzhandler($i,$m);
return($i);
}
ob_start('a');
?>
PAGE CONTENTS
Expected result:
----------------
send buffer in lower case
Actual result:
--------------
send buffer in UPPER case when browser does't support gzip/deflate
compression
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=36525&edit=1