From c1f7eb05cae1860b4da9da1f94cb089b616f4be1 Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Tue, 13 Nov 2018 19:40:48 -0700 Subject: [PATCH] Better sanatization of menu/prompt.hjson files based on board name --- core/oputil/oputil_config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/oputil/oputil_config.js b/core/oputil/oputil_config.js index 2e8b0add..dd6fc783 100644 --- a/core/oputil/oputil_config.js +++ b/core/oputil/oputil_config.js @@ -257,7 +257,7 @@ function buildNewConfig() { return; } - const bn = sanatizeFilename(config.general.boardName).replace(/ /g, '_').toLowerCase(); + const bn = sanatizeFilename(config.general.boardName).replace(/[^a-z0-9_\-]/ig, '_').toLowerCase(); const menuFile = `${bn}.hjson`; copyFileSyncSilent( paths.join(__dirname, '../../config/menu.hjson'),