mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-05-06 20:42:57 +08:00
@@ -73,14 +73,6 @@ function validateFileName(fileName: string): string {
|
||||
if (!fileName.trim()) {
|
||||
return 'File name is required'
|
||||
}
|
||||
const invalidChars = /[<>:"/\\|?*]/g
|
||||
if (invalidChars.test(fileName)) {
|
||||
return 'File name contains invalid characters'
|
||||
}
|
||||
const reservedNames = /^(CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9])$/i
|
||||
if (reservedNames.test(fileName.trim())) {
|
||||
return 'This is a reserved file name'
|
||||
}
|
||||
return ''
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user