Skip to content

Commit

Permalink
- Updated regex
Browse files Browse the repository at this point in the history
  • Loading branch information
elipe17 committed Sep 5, 2023
1 parent 153472a commit e2b1551
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions tdrs-frontend/src/components/FileUpload/FileUpload.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,8 @@ function FileUpload({ section, setLocalAlertState }) {
/* istanbul ignore next */
if (!evt.target.error) {
// Validate file extension before proceeding
const re = /(\.txt|\.ms\d{2}|\.ts\d{2,3})/i
const filename = file.name
const n = filename.lastIndexOf('.')
const ext = filename.substring(n)
if (!re.exec(ext)) {
const re = /(\.txt|\.ms\d{2}|\.ts\d{2,3})$/i
if (!re.exec(file.name)) {
// reject the file and create an error message
createFileInputErrorState(input, dropTarget)

Expand Down

0 comments on commit e2b1551

Please sign in to comment.