mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-22 06:02:26 +01:00
Merge pull request #3981 from Snarling/B&AFix
FILES: FIX #3979 Allow characters & and ' in filenames
This commit is contained in:
commit
d553a1d2f4
@ -38,7 +38,7 @@ export function removeTrailingSlash(s: string): string {
|
|||||||
export function isValidFilename(filename: string): boolean {
|
export function isValidFilename(filename: string): boolean {
|
||||||
// Allows alphanumerics, hyphens, underscores, and percentage signs
|
// Allows alphanumerics, hyphens, underscores, and percentage signs
|
||||||
// Must have a file extension
|
// 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
|
// match() returns null if no match is found
|
||||||
return filename.match(regex) != null;
|
return filename.match(regex) != null;
|
||||||
|
Loading…
Reference in New Issue
Block a user