Skip to content

Commit

Permalink
Properly handle rar archives that do not have 'pack_size' block defined
Browse files Browse the repository at this point in the history
  • Loading branch information
DariusIII committed Jan 14, 2019
1 parent 1939d8a commit 0c39ba6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions RarInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
* @author Hecks
* @copyright (c) 2010-2016 Hecks
* @license Modified BSD
* @version 5.8
* @version 5.9
*/
class RarInfo extends ArchiveReader
{
Expand Down Expand Up @@ -715,7 +715,7 @@ protected function getFileBlockSummary($block, $quickOpen = false)
if (!empty($block['is_dir'])) {
$ret['is_dir'] = 1;
} elseif (!$quickOpen && !in_array(self::BLOCK_FILE, $this->headersOnly['type'], false)) {
$packSize = empty($block['pack_size']) ? 0 : $block['pack_size'];
$packSize = empty($block['pack_size']) ? $block['data_size'] : $block['pack_size'];
$start = $this->start + $block['offset'] + $block['head_size'];
$end = min($this->end, $start + $packSize - 1);
$ret['range'] = "{$start}-{$end}";
Expand Down

0 comments on commit 0c39ba6

Please sign in to comment.