Allow all characters (except /) when sanitazing

This commit is contained in:
K1-K1 2021-01-14 13:42:08 +00:00 committed by GitHub
parent 82a1d6722d
commit d918d93bbc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -32,7 +32,7 @@ function pathComponent(path, i) {
const components = path.split('/');
return components[i >= 0 ? i : components.length + i];
}
function sanitize(s) { return s.replace(/[^A-Za-z0-9_\-\.]/gm, '_'); }
function sanitize(s) { return s.replace(/[\/]/gm, '_'); }
const stringToUtf8Array = (function() {
const encoder = new TextEncoder("utf-8");
return str => encoder.encode(str);