note 90922 deleted from function.gzdecode by danbrown
| From: | danbrown@php.net | Date: | Sat, 16 May 2009 16:22:49 +0000 |
| Subject: | note 90922 deleted from function.gzdecode by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-154672@lists.php.net to get a copy of this message | ||
Note Submitter: Anonymous
----
@ katzlbtjunk at hotmail dot com
There is a typo in line 18 of your gzdecode() function.
<?php
# WRONG
$os = substr($data,8,1);
# CORRECT
$os = substr($data,9,1);
?>.
Additionally, the version is not future-proof, because it treats reserved flag bits as permanently
set to zero. If the standard is amended to support other values this piece of code would return
"Reserved bits not allowed." error instead of producing a warning (possibly), and
continuting parsing.
Thanks for your work, anyway. You saved me some time!