#49411 [NEW]: zlib.inflate Stream Filter Broken
| From: | alex at malexmedia dot net | Date: | Sat, 29 Aug 2009 21:53:56 +0000 |
| Subject: | #49411 [NEW]: zlib.inflate Stream Filter Broken | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-141698@lists.php.net to get a copy of this message | ||
From: alex at malexmedia dot net
Operating system: Linux
PHP version: 5.2.10
PHP Bug Type: Zlib Related
Bug description: zlib.inflate Stream Filter Broken
Description:
------------
The ZLib "inflate" stream filter appears to be broken in PHP 5.2.9 and
5.2.10. When trying to inflate a GZip file, or even a stream previously
compressed with zlib.deflate, zlib.inflate returns no output.
Reproduce code:
---------------
<?php
//zlibtest.php
//Usage:
// $ echo TEST TEST TEST | gzip | php zlibtest.php
$input = fopen("php://stdin", "rb");
stream_filter_append($input, 'zlib.inflate', STREAM_FILTER_READ);
while(!feof($input) && ($buffer = fread($input, 8192)) !== FALSE)
fwrite(STDOUT, $buffer);
fclose($input);
//Inexplicably, this will produce no output on STDOUT.
//Even the example at http://us3.php.net/filters.compression behaves
incorrectly.
?>
Expected result:
----------------
I expect to see "TEST TEST TEST" on the command line.
Actual result:
--------------
The zlib.inflate filter is clearly not producing decompressed results on
fread() operations. By my reckoning, this is a problem.
--
Edit bug report at http://bugs.php.net/?id=49411&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=49411&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=49411&r=trysnapshot53
Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=49411&r=trysnapshot60
Fixed in SVN: http://bugs.php.net/fix.php?id=49411&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=49411&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=49411&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=49411&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=49411&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=49411&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=49411&r=support
Expected behavior: http://bugs.php.net/fix.php?id=49411&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=49411&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=49411&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=49411&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=49411&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=49411&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=49411&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=49411&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=49411&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=49411&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=49411&r=mysqlcfg