Skip to content

Commit

Permalink
TAR: allow duplicate filenames
Browse files Browse the repository at this point in the history
It's possible (if inadvisable) to have multiple entries with the same filename, getID3 will now show these. Breaking change: `[tar][file_details]` is now numeric-keyed rather than filename-keyed (the filename is still present under `[tar][file_details][#][name]`)
  • Loading branch information
JamesHeinrich committed Feb 2, 2025
1 parent 290b5d6 commit bb8f548
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion getid3/getid3.php
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ class getID3
*/
protected $startup_warning = '';

const VERSION = '1.9.23-202501071203';
const VERSION = '1.9.23-202502021530';
const FREAD_BUFFER_SIZE = 32768;

const ATTACHMENTS_NONE = false;
Expand Down
4 changes: 2 additions & 2 deletions getid3/module.archive.tar.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public function Analyze() {
if ($name == '') {
break;
}
$info['tar']['file_details'][$name] = array (
$info['tar']['file_details'][] = array (
'name' => $name,
'mode_raw' => $mode,
'mode' => self::display_perms($mode),
Expand All @@ -117,7 +117,7 @@ public function Analyze() {
'devmajor' => $devmaj,
'devminor' => $devmin
);
$info['tar']['files'] = getid3_lib::array_merge_clobber($info['tar']['files'], getid3_lib::CreateDeepArray($info['tar']['file_details'][$name]['name'], '/', $size));
$info['tar']['files'] = getid3_lib::array_merge_clobber($info['tar']['files'], getid3_lib::CreateDeepArray($name, '/', $size));
}
return true;
}
Expand Down

0 comments on commit bb8f548

Please sign in to comment.