From 44c2af88ea73db49710a5e0cc2c9f32a73ff06cc Mon Sep 17 00:00:00 2001 From: Joseph Milazzo Date: Tue, 23 Mar 2021 14:51:56 -0500 Subject: [PATCH] Some security issue found in scan. --- API/Parser/Parser.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/API/Parser/Parser.cs b/API/Parser/Parser.cs index aad2bd557..af0383a81 100644 --- a/API/Parser/Parser.cs +++ b/API/Parser/Parser.cs @@ -403,20 +403,17 @@ namespace API.Parser public static bool IsArchive(string filePath) { - var fileInfo = new FileInfo(filePath); - return MangaFileRegex.IsMatch(fileInfo.Extension); + return MangaFileRegex.IsMatch(Path.GetExtension(filePath)); } public static bool IsImage(string filePath) { - var fileInfo = new FileInfo(filePath); - return ImageRegex.IsMatch(fileInfo.Extension); + return ImageRegex.IsMatch(Path.GetExtension(filePath)); } public static bool IsXml(string filePath) { - var fileInfo = new FileInfo(filePath); - return XmlRegex.IsMatch(fileInfo.Extension); + return XmlRegex.IsMatch(Path.GetExtension(filePath)); } public static float MinimumNumberFromRange(string range)