From bce83cb6fbc98f8198564c9399821f5829acc767 Mon Sep 17 00:00:00 2001 From: Sabir Hassan Date: Thu, 25 Aug 2022 14:27:42 +0500 Subject: [PATCH] fix: allow underscores in file name --- web/src/components/filePathInputModal.tsx | 2 +- web/src/components/nameInputModal.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/web/src/components/filePathInputModal.tsx b/web/src/components/filePathInputModal.tsx index f5bcca6..cfe7975 100644 --- a/web/src/components/filePathInputModal.tsx +++ b/web/src/components/filePathInputModal.tsx @@ -23,7 +23,7 @@ const FilePathInputModal = ({ const handleChange = (event: React.ChangeEvent) => { const value = event.target.value - const specialChars = /[`!@#$%^&*()_+\-=[\]{};':"\\|,<>?~]/ + const specialChars = /[`!@#$%^&*()+\-=[\]{};':"\\|,<>?~]/ const fileExtension = /\.(exe|sh|htaccess)$/i if (specialChars.test(value)) { diff --git a/web/src/components/nameInputModal.tsx b/web/src/components/nameInputModal.tsx index 3ae8364..a3bff3a 100644 --- a/web/src/components/nameInputModal.tsx +++ b/web/src/components/nameInputModal.tsx @@ -44,7 +44,7 @@ const NameInputModal = ({ const value = event.target.value const folderNameRegex = /[`!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?~]/ - const fileNameRegex = /[`!@#$%^&*()_+\-=[\]{};':"\\|,<>/?~]/ + const fileNameRegex = /[`!@#$%^&*()+\-=[\]{};':"\\|,<>/?~]/ const fileNameExtensionRegex = /.(exe|sh|htaccess)$/i const specialChars = isFolder ? folderNameRegex : fileNameRegex