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

Commit

Permalink
fix foreign chars
Browse files Browse the repository at this point in the history
  • Loading branch information
SpikeHD committed May 8, 2022
1 parent c72e00f commit ed59684
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions resources/js/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit ed59684

Please sign in to comment.