[ArchiveTools] Add extension filtering for archives

This commit is contained in:
Matt Nadareski
2016-08-18 19:54:37 -07:00
parent 90eca58e46
commit 9c26eb9710

View File

@@ -584,6 +584,13 @@ namespace SabreTools.Helper
{
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
try
{