Closed AdamRaichu closed 5 months ago
Describe the bug When zipping a folder that has square brackets [] or other
[]
To Reproduce Steps to reproduce the behavior:
Example [Folder]
Expected behavior The zip file should contain files.
Environment What type of VS Code were you using when you encountered the problem?
Windows, but this should affect all platforms.
Additional context Add any other context about the problem here.
No error is shown with this example folder name, but errors do occur with unclosed brackets.
The code in question:
https://github.com/AdamRaichu/vscode-zip-viewer/blob/9f271ba008ba69e2a7edd16c40a0d81115eb7e20/src/cmds.js#L130
Should add the following function to fix.
// From https://stackoverflow.com/questions/3446170/escape-string-for-use-in-javascript-regex function escapeRegExp(string) { return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); }
Describe the bug When zipping a folder that has square brackets
[]
or otherTo Reproduce Steps to reproduce the behavior:
Example [Folder]
.Expected behavior The zip file should contain files.
Environment What type of VS Code were you using when you encountered the problem?
Windows, but this should affect all platforms.
Additional context Add any other context about the problem here.
No error is shown with this example folder name, but errors do occur with unclosed brackets.
The code in question:
https://github.com/AdamRaichu/vscode-zip-viewer/blob/9f271ba008ba69e2a7edd16c40a0d81115eb7e20/src/cmds.js#L130
Should add the following function to fix.