Implement case-insensitive matching for file extensions (#3570)

Enable case-insensitive matching when determining file extensions in the application. This enhancement ensures that the system accurately recognizes and processes file extensions regardless of the case used in the filenames.
This commit is contained in:
RomainBerthet 2024-01-04 23:44:47 +01:00 committed by GitHub
parent 33c3d6f5d4
commit 9366961d02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -71,7 +71,7 @@ export const supportedExtensions = {
export function getFileExtension(fileName: string): string | null { export function getFileExtension(fileName: string): string | null {
if (fileName) { if (fileName) {
const match = fileName.match(/\.([^\./\?\#]+)($|\?|\#)/); const match = fileName.toLowerCase().match(/\.([^\./\?\#]+)($|\?|\#)/);
return match ? match[1] : null; return match ? match[1] : null;
} }