|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-06-15 23:29 UTC] hardcorevenom at gmx dot de
-Summary: CRC32 Error not reported
+Summary: ZipArchive: CRC32 errors / corrupted archives not
reported
[2010-06-15 23:29 UTC] hardcorevenom at gmx dot de
[2010-06-16 00:35 UTC] hardcorevenom at gmx dot de
[2010-06-20 17:49 UTC] felipe@php.net
-Status: Open
+Status: Assigned
-Assigned To:
+Assigned To: pajoye
[2010-06-20 17:57 UTC] pajoye@php.net
-Status: Assigned
+Status: Feedback
[2010-06-20 17:57 UTC] pajoye@php.net
[2010-06-23 18:38 UTC] hardcorevenom at gmx dot de
-Status: Feedback
+Status: Open
[2010-06-23 18:38 UTC] hardcorevenom at gmx dot de
[2010-06-26 23:38 UTC] felipe@php.net
-Status: Open
+Status: Assigned
[2011-01-31 16:27 UTC] schmale at froglogic dot com
[2011-01-31 16:54 UTC] pajoye@php.net
[2016-09-06 15:30 UTC] cmb@php.net
[2017-10-24 07:38 UTC] kalle@php.net
-Status: Assigned
+Status: Open
-Assigned To: pajoye
+Assigned To:
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 13:00:01 2025 UTC |
Description: ------------ I corrupted a file using a hex editor. "echo shell_exec('unzip -t file')" shows the CRC32 mismatch. ZipArchive::extractTo() doesn't report CRC32 errors. Reading a stream received from ZipArchive::getStream('myfile') echoes a CRC error if the number of bytes read with one fread() is below 2157 bytes. Test script: --------------- $zip = new ZipArchive(); if ($zip->open('test.zip')) { zip->extractTo('mydir'); //no error printed $fp = $z->getStream('brokenfile'); while (!feof($fp)) { $buf .= fread($fp, 2048+108); //CRC error printed } $fclose($fp); $fp = $z->getStream('brokenfile'); while (!feof($fp)) { $buf .= fread($fp, 2048+109); //CRC error NOT printed } $fclose($fp); zip.close() } Expected result: ---------------- A CRC32 error report that can be handled. The one from "fread($fp, 2048+108)" is fine: "Warning: fread() [function.fread]: Zip stream error: CRC error in ..." (can be handled with "ob_get_contents()"); For "ZipArchive::extractTo()" the corrupt file(s) should be printed. Actual result: -------------- CRC32 errors are reported always.