diff --git a/lib/util/fs/util.spec.ts b/lib/util/fs/util.spec.ts index c37d971b0673f6..345acf38c21adc 100644 --- a/lib/util/fs/util.spec.ts +++ b/lib/util/fs/util.spec.ts @@ -73,6 +73,7 @@ describe('util/fs/util', () => { ${'/foo'} | ${false} ${'&&'} | ${false} ${';'} | ${true} + ${'./[foo]/bar'} | ${true} `('isValidPath($value) == $expected', ({ value, expected }) => { expect(isValidPath(value, 'cacheDir')).toBe(expected); }); diff --git a/lib/util/fs/util.ts b/lib/util/fs/util.ts index ab7df10fdb1990..d43d6e27b6f27c 100644 --- a/lib/util/fs/util.ts +++ b/lib/util/fs/util.ts @@ -5,7 +5,7 @@ import { logger } from '../../logger'; // http://www.mtu.edu/umc/services/digital/writing/characters-avoid/ // We allow spaces, but not newlines -const restricted = /[[\]#%&<>*?\b\n\r\0!'"|‘“^`]/; +const restricted = /[#%&<>*?\b\n\r\0!'"|‘“^`]/; function assertBaseDir(path: string, baseDir: string): void { if (!path.startsWith(baseDir)) {