Skip to content

Commit e74e6e5

Browse files
committed
Clean characters on filenames too
1 parent 4ba5831 commit e74e6e5

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

ui/arduino/store.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ function store(state, emitter) {
166166
let editor = state.cache(AceEditor, 'editor').editor
167167
let contents = cleanCharacters(editor.getValue())
168168
editor.setValue(contents)
169-
let filename = state.selectedFile || 'undefined'
169+
let filename = cleanCharacters(state.selectedFile) || 'undefined'
170170
let deviceName = getDeviceName(state.selectedDevice)
171171

172172
state.blocking = true
@@ -511,7 +511,7 @@ function store(state, emitter) {
511511
})
512512
emitter.on('save-filename', async (filename) => {
513513
log('save-filename', filename)
514-
514+
filename = cleanCharacters(filename)
515515
// no changes
516516
if (state.selectedFile === filename) {
517517
state.isEditingFilename = false
@@ -685,8 +685,6 @@ function resizeEditor(state) {
685685
}
686686
}
687687

688-
689-
690688
function cleanCharacters(str) {
691689
return str.replace(/[\u{0080}-\u{FFFF}]/gu,"")
692690
}

0 commit comments

Comments
 (0)