mirror of
https://github.com/Nystik-gh/ignis.git
synced 2026-06-17 04:35:53 +00:00
fix bug in vault resolve
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user