fix bug in vault resolve
This commit is contained in:
parent
bd6161bd31
commit
b4fa193d2d
1 changed files with 3 additions and 1 deletions
|
|
@ -72,7 +72,9 @@ function resolveVaultPath(vaultRoot, relativePath) {
|
||||||
const cleaned = (relativePath || "").replace(/^\/+/, "");
|
const cleaned = (relativePath || "").replace(/^\/+/, "");
|
||||||
const resolved = path.resolve(vaultRoot, cleaned);
|
const resolved = path.resolve(vaultRoot, cleaned);
|
||||||
|
|
||||||
if (!resolved.startsWith(path.resolve(vaultRoot))) {
|
const resolvedRoot = path.resolve(vaultRoot);
|
||||||
|
|
||||||
|
if (resolved !== resolvedRoot && !resolved.startsWith(resolvedRoot + path.sep)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return resolved;
|
return resolved;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue