1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-24 22:36:19 -04:00

Fixed: Failing dangerous and executable single file downloads

This commit is contained in:
Stevie Robinson
2025-01-26 03:29:07 +01:00
committed by GitHub
parent 103ccd74f3
commit e37684e045
2 changed files with 21 additions and 1 deletions
@@ -260,6 +260,26 @@ namespace NzbDrone.Core.MediaFiles
var extension = Path.GetExtension(fileInfo.Name);
if (FileExtensions.DangerousExtensions.Contains(extension))
{
return new List<ImportResult>
{
new ImportResult(new ImportDecision(new LocalEpisode { Path = fileInfo.FullName },
new ImportRejection(ImportRejectionReason.DangerousFile, $"Caution: Found potentially dangerous file with extension: {extension}")),
$"Caution: Found potentially dangerous file with extension: {extension}")
};
}
if (FileExtensions.ExecutableExtensions.Contains(extension))
{
return new List<ImportResult>
{
new ImportResult(new ImportDecision(new LocalEpisode { Path = fileInfo.FullName },
new ImportRejection(ImportRejectionReason.ExecutableFile, $"Caution: Found executable file with extension: '{extension}'")),
$"Caution: Found executable file with extension: '{extension}'")
};
}
if (extension.IsNullOrWhiteSpace() || !MediaFileExtensions.Extensions.Contains(extension))
{
_logger.Debug("[{0}] has an unsupported extension: '{1}'", fileInfo.FullName, extension);