note 79042 added to function.gzuncompress
| From: | heavyccasey at gmail dot com | Date: | Thu, 08 Nov 2007 04:30:21 +0000 |
| Subject: | note 79042 added to function.gzuncompress | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-132097@lists.php.net to get a copy of this message | ||
Note that gzuncompress() may not decompress some compressed strings and return a Data Error.
The problem could be that the outside compressed string has a CRC32 checksum at the end of the file
instead of Adler-32, like PHP expects.
Workaround:
<?php
function gzuncompress_crc32($data) {
$f = tempnam('/tmp', 'gz_fix');
file_put_contents($f, "\x1f\x8b\x08\x00\x00\x00\x00\x00" . $data);
return file_get_contents('compress.zlib://' . $f);
}
?>
----
Server IP: 64.71.164.2
Probable Submitter: 24.5.135.180
----
Manual Page -- http://www.php.net/manual/en/function.gzuncompress.php
Edit -- https://master.php.net/note/edit/79042
Del: integrated -- https://master.php.net/note/delete/79042/integrated
Del: useless -- https://master.php.net/note/delete/79042/useless
Del: bad code -- https://master.php.net/note/delete/79042/bad+code
Del: spam -- https://master.php.net/note/delete/79042/spam
Del: non-english -- https://master.php.net/note/delete/79042/non-english
Del: in docs -- https://master.php.net/note/delete/79042/in+docs
Del: other reasons-- https://master.php.net/note/delete/79042
Reject -- https://master.php.net/note/reject/79042
Search -- https://master.php.net/manage/user-notes.php