diff --git a/core/util/paths.ts b/core/util/paths.ts index 92ea5be94..315053413 100644 --- a/core/util/paths.ts +++ b/core/util/paths.ts @@ -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;