Skip to content

Commit

Permalink
Replace spaces & slashes in keyboard names with underscores before th…
Browse files Browse the repository at this point in the history
…ey can get trimmed (qmk#366)
  • Loading branch information
fauxpark authored and yanfali committed May 24, 2019
1 parent 17612ad commit dc9cc5f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/store/modules/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ const getters = {
exportKeymapName: state => {
let exportName = state.keymapName.replace(/[\s/]/g, '_').toLowerCase();
if (exportName === '') {
exportName = `${state.keyboard}_${state.layout}_mine`.toLowerCase();
let keyboardName = state.keyboard.replace(/[\s/]/g, '_').toLowerCase();
exportName = `${keyboardName}_${state.layout}_mine`.toLowerCase();
}
// issue #331 whitelist what we send to API for keymapName and save to disk
exportName = exportName.replace(/[^a-z0-9_-]/gi, '');
Expand Down

0 comments on commit dc9cc5f

Please sign in to comment.