note 108948 added to function.gzinflate
| From: | niblett at gmail dot com | Date: | Thu, 07 Jun 2012 14:08:14 +0000 |
| Subject: | note 108948 added to function.gzinflate | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-188441@lists.php.net to get a copy of this message | ||
alternative, with detection for optional filename header
<?php
function gzdecode($data) {
// check if filename field is set in FLG, is 4th byte
$hex = bin2hex($data);
$flg = (int)hexdec(substr($hex, 6, 2));
// remove headers
$hex = substr($hex, 20);
$ret = '';
if ( ($flg & 0x8) == 8 ){
print "ello";
for ( $i = 0; $i < strlen($hex); $i += 2 ){
$value = substr($hex, $i, 2);
if ( $value == '00' ){
$ret = substr($hex, ($i+2));
break;
}
}
}
return gzinflate(pack('H*', $ret));
}
?>
----
Server IP: 69.147.83.197
Probable Submitter: 82.161.178.213
----
Manual Page -- http://www.php.net/manual/en/function.gzinflate.php
Edit -- https://master.php.net/note/edit/108948
Del: integrated -- https://master.php.net/note/delete/108948/integrated
Del: useless -- https://master.php.net/note/delete/108948/useless
Del: bad code -- https://master.php.net/note/delete/108948/bad+code
Del: spam -- https://master.php.net/note/delete/108948/spam
Del: non-english -- https://master.php.net/note/delete/108948/non-english
Del: in docs -- https://master.php.net/note/delete/108948/in+docs
Del: other reasons-- https://master.php.net/note/delete/108948
Reject -- https://master.php.net/note/reject/108948
Search -- https://master.php.net/manage/user-notes.php