From d5102099d651ba31566e2f79f09f689fa16fcef3 Mon Sep 17 00:00:00 2001 From: nlf Date: Mon, 11 Jul 2022 11:52:11 -0700 Subject: [PATCH] fix: tighten up the character set that will be removed (#93) the original implementation was wrong, the documented disallowed characters are 0-31 not \x00-\x31 --- lib/escape.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/escape.js b/lib/escape.js index 3c57437..303100d 100644 --- a/lib/escape.js +++ b/lib/escape.js @@ -68,7 +68,7 @@ const sh = (input) => { // disabling the no-control-regex rule for this line as we very specifically _do_ want to // replace those characters if they somehow exist at this point, which is highly unlikely // eslint-disable-next-line no-control-regex -const filename = (input) => input.replace(/[<>:"/\\|?*\x00-\x31]/g, '') +const filename = (input) => input.replace(/[<>:"/\\|?*\x00-\x1F]/g, '') module.exports = { cmd,