Allow & and ' in filenames

This commit is contained in:
Snarling 2022-08-17 08:14:15 -04:00
parent ba5b0be7f4
commit 9e2e459cc2

@ -38,7 +38,7 @@ export function removeTrailingSlash(s: string): string {
export function isValidFilename(filename: string): boolean {
// Allows alphanumerics, hyphens, underscores, and percentage signs
// Must have a file extension
const regex = /^[.a-zA-Z0-9_-]+[.][a-zA-Z0-9]+(?:-\d+(?:\.\d*)?%-INC)?$/;
const regex = /^[.&'a-zA-Z0-9_-]+\.[a-zA-Z0-9]+(?:-\d+(?:\.\d*)?%-INC)?$/;
// match() returns null if no match is found
return filename.match(regex) != null;