Improve file extension checks in CanHandle methods

This commit is contained in:
ema
2025-07-12 03:39:37 +08:00
parent 10ce29e836
commit 0714574374
2 changed files with 3 additions and 2 deletions

View File

@@ -108,7 +108,7 @@ public class Plugin : IViewer
// Disabled due mishandling text file types e.g., "*.config".
// Only check extension for well known image and animated image types.
return !Directory.Exists(path) && WellKnownExtensions.Contains(Path.GetExtension(path).ToLower());
return !Directory.Exists(path) && WellKnownExtensions.Any(ext => path.EndsWith(ext, StringComparison.OrdinalIgnoreCase));
}
public void Prepare(string path, ContextObject context)