We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 151c93d commit ed2fd8bCopy full SHA for ed2fd8b
1 file changed
src/Zip.php
@@ -554,19 +554,17 @@ protected function readCentralDir()
554
@fseek($this->fh, $size - $maximum_size);
555
$pos = ftell($this->fh);
556
$bytes = 0x00000000;
557
- $found = false;
558
559
while ($pos < $size) {
560
$byte = @fread($this->fh, 1);
561
$bytes = (($bytes << 8) & 0xFFFFFFFF) | ord($byte);
562
if ($bytes == 0x504b0506) {
563
- $found = true;
564
break;
565
}
566
$pos++;
567
568
569
- if (!$found) {
+ if ($bytes != 0x504b0506) {
570
throw new ArchiveCorruptedException(
571
'End of central directory signature not found - not a valid ZIP file'
572
);
0 commit comments