From ed59684ac93fa5dec33f656f9a5723608ee2e778 Mon Sep 17 00:00:00 2001 From: SpikeHD Date: Sun, 8 May 2022 12:37:08 -0700 Subject: [PATCH] fix foreign chars --- resources/js/helpers.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) {