fix loading themes with spaces in their name

This commit is contained in:
Vendicated 2025-06-09 01:56:04 +02:00
parent b19bb2b7af
commit 18f2b49b67
No known key found for this signature in database
GPG key ID: D66986BAF75ECF18
2 changed files with 21 additions and 13 deletions

View file

@ -35,7 +35,7 @@ import { makeLinksOpenExternally } from "./utils/externalLinks";
mkdirSync(THEMES_DIR, { recursive: true });
export function ensureSafePath(basePath: string, path: string) {
const normalizedBasePath = normalize(basePath);
const normalizedBasePath = normalize(basePath + "/");
const newPath = join(basePath, path);
const normalizedPath = normalize(newPath);
return normalizedPath.startsWith(normalizedBasePath) ? normalizedPath : null;