@@ 4559-4566 (lines=8) @@ | ||
4556 | // ----- Go to the end of the zip file |
|
4557 | $v_size = filesize($this->zipname); |
|
4558 | @fseek($this->zip_fd, $v_size); |
|
4559 | if (@ftell($this->zip_fd) != $v_size) |
|
4560 | { |
|
4561 | // ----- Error log |
|
4562 | PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to go to the end of the archive \''.$this->zipname.'\''); |
|
4563 | ||
4564 | // ----- Return |
|
4565 | return PclZip::errorCode(); |
|
4566 | } |
|
4567 | ||
4568 | // ----- First try : look if this is an archive with no commentaries (most of the time) |
|
4569 | // in this case the end of central dir is at 22 bytes of the file end |
|
@@ 4573-4580 (lines=8) @@ | ||
4570 | $v_found = 0; |
|
4571 | if ($v_size > 26) { |
|
4572 | @fseek($this->zip_fd, $v_size-22); |
|
4573 | if (($v_pos = @ftell($this->zip_fd)) != ($v_size-22)) |
|
4574 | { |
|
4575 | // ----- Error log |
|
4576 | PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to seek back to the middle of the archive \''.$this->zipname.'\''); |
|
4577 | ||
4578 | // ----- Return |
|
4579 | return PclZip::errorCode(); |
|
4580 | } |
|
4581 | ||
4582 | // ----- Read for bytes |
|
4583 | $v_binary_data = @fread($this->zip_fd, 4); |
|
@@ 4600-4607 (lines=8) @@ | ||
4597 | if ($v_maximum_size > $v_size) |
|
4598 | $v_maximum_size = $v_size; |
|
4599 | @fseek($this->zip_fd, $v_size-$v_maximum_size); |
|
4600 | if (@ftell($this->zip_fd) != ($v_size-$v_maximum_size)) |
|
4601 | { |
|
4602 | // ----- Error log |
|
4603 | PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to seek back to the middle of the archive \''.$this->zipname.'\''); |
|
4604 | ||
4605 | // ----- Return |
|
4606 | return PclZip::errorCode(); |
|
4607 | } |
|
4608 | ||
4609 | // ----- Read byte per byte in order to find the signature |
|
4610 | $v_pos = ftell($this->zip_fd); |