mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[ArchiveTools] Add extension filtering for archives
This commit is contained in:
@@ -584,6 +584,13 @@ namespace SabreTools.Helper
|
|||||||
{
|
{
|
||||||
ArchiveType? outtype = null;
|
ArchiveType? outtype = null;
|
||||||
|
|
||||||
|
// First line of defense is going to be the extension, for better or worse
|
||||||
|
string ext = Path.GetExtension(input).ToLowerInvariant();
|
||||||
|
if (ext != "7z" && ext != "gz" && ext != "rar" && ext != "tar" && ext != "zip" && ext != "z")
|
||||||
|
{
|
||||||
|
return outtype;
|
||||||
|
}
|
||||||
|
|
||||||
// Read the first bytes of the file and get the magic numbe
|
// Read the first bytes of the file and get the magic numbe
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user