note 90922 added to function.gzdecode

From: Date: Sat, 16 May 2009 14:54:21 +0000
Subject: note 90922 added to function.gzdecode
Groups: php.notes 
Request: Send a blank email to php-notes+get-154668@lists.php.net to get a copy of this message
@ 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! ---- Server IP: 62.237.7.3 Probable Submitter: 195.148.29.214 ---- Manual Page -- http://www.php.net/manual/en/function.gzdecode.php Edit -- https://master.php.net/note/edit/90922 Del: integrated -- https://master.php.net/note/delete/90922/integrated Del: useless -- https://master.php.net/note/delete/90922/useless Del: bad code -- https://master.php.net/note/delete/90922/bad+code Del: spam -- https://master.php.net/note/delete/90922/spam Del: non-english -- https://master.php.net/note/delete/90922/non-english Del: in docs -- https://master.php.net/note/delete/90922/in+docs Del: other reasons-- https://master.php.net/note/delete/90922 Reject -- https://master.php.net/note/reject/90922 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#154668) next »