Skip to content

Commit 78ccb06

Browse files
committed
use filepath.IsLocal for subdir path validation
1 parent a62cbcf commit 78ccb06

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

internal/pkg/create/create.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ func normalizeSubdir(subdir string) (string, error) {
370370
if cleaned == "." || cleaned == "/" {
371371
return "", nil
372372
}
373-
if strings.HasPrefix(cleaned, "..") || filepath.IsAbs(cleaned) {
373+
if !filepath.IsLocal(cleaned) {
374374
return "", slackerror.New(slackerror.ErrSubdirNotFound).
375375
WithMessage("subdirectory path %q must be relative and within the template", subdir)
376376
}

0 commit comments

Comments
 (0)