corrected to checking against clean paths
This commit is contained in:
parent
b11e831a20
commit
522d62ff11
1 changed files with 3 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue