Fix IsPathInDir (#1192)

This commit is contained in:
WithoutPants
2021-03-11 13:37:13 +11:00
committed by GitHub
parent 55aee21cff
commit a3a531d122
3 changed files with 45 additions and 1 deletions

View File

@@ -276,7 +276,7 @@ func IsPathInDir(dir, pathToCheck string) bool {
rel, err := filepath.Rel(dir, pathToCheck)
if err == nil {
if !strings.HasPrefix(rel, ".."+string(filepath.Separator)) {
if !strings.HasPrefix(rel, "..") {
return true
}
}