mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-21 04:17:01 -04:00
fix loading themes with spaces in their name
This commit is contained in:
parent
b19bb2b7af
commit
18f2b49b67
2 changed files with 21 additions and 13 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue