From 522d62ff112a2625353825ebee0a1a89bda4272c Mon Sep 17 00:00:00 2001 From: adarshramiyer Date: Wed, 9 Jul 2025 20:44:08 -0700 Subject: [PATCH] corrected to checking against clean paths --- core/util/paths.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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;