diff --git a/resources/js/helpers.js b/resources/js/helpers.js index 8f46d76..6f223af 100644 --- a/resources/js/helpers.js +++ b/resources/js/helpers.js @@ -129,13 +129,13 @@ async function openGrasscutterFolder() { // https://www.jimzhao.us/2015/09/javascript-detect-chinese-character.html function hasForeignChars(str) { - let re1 = /^[A-Za-z\d,.?;:\\/'"!$%() ]*/g + let re1 = /[^a-z0-9_.,-\\/: ]/g str = str.replace(/\s/g, '') debug.log('Checking for foreign chars in path: ', str) debug.log('Path includes foreign chars? ', re1.test(str)) - return !re1.test(str) + return re1.test(str) } function openDialog(title, message, negBtn = false, affirmBtn = closeDialog) {