corrected to checking against clean paths

This commit is contained in:
adarshramiyer 2025-07-09 20:44:08 -07:00
parent b11e831a20
commit 522d62ff11

View file

@ -494,7 +494,9 @@ export const isFileWithinFolder = (
filePath = filePath.replace(/\/$/, "");
folderPathClean = folderPathClean.replace(/\/$/, "");
return filePath === folderPath || filePath.startsWith(`${folderPath}/`);
return (
filePath === folderPathClean || filePath.startsWith(`${folderPathClean}/`)
);
} catch (error) {
console.error("Error in isFileWithinFolder:", error);
return false;