Skip to content
This repository was archived by the owner on Jul 5, 2022. It is now read-only.

Commit ed59684

Browse files
committed
fix foreign chars
1 parent c72e00f commit ed59684

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

resources/js/helpers.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,13 @@ async function openGrasscutterFolder() {
129129

130130
// https://www.jimzhao.us/2015/09/javascript-detect-chinese-character.html
131131
function hasForeignChars(str) {
132-
let re1 = /^[A-Za-z\d,.?;:\\/'"!$%() ]*/g
132+
let re1 = /[^a-z0-9_.,-\\/: ]/g
133133
str = str.replace(/\s/g, '')
134134

135135
debug.log('Checking for foreign chars in path: ', str)
136136
debug.log('Path includes foreign chars? ', re1.test(str))
137137

138-
return !re1.test(str)
138+
return re1.test(str)
139139
}
140140

141141
function openDialog(title, message, negBtn = false, affirmBtn = closeDialog) {

0 commit comments

Comments
 (0)