mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-13 07:26:26 +00:00
fix(fs): permit square brackets []
in file paths (#21625)
Co-authored-by: Sebastian Poxhofer <secustor@users.noreply.github.com>
This commit is contained in:
parent
d6b5679977
commit
b853af2c7d
2 changed files with 2 additions and 1 deletions
|
@ -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);
|
||||
});
|
||||
|
|
|
@ -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)) {
|
||||
|
|
Loading…
Reference in a new issue