Contains to HasPrefix
This commit is contained in:
parent
01609df902
commit
77a21330df
|
|
@ -595,7 +595,7 @@ func ValidFileName(fname string) (err error) {
|
|||
}
|
||||
// make sure basename does not include ".." or path separators
|
||||
_, basename := filepath.Split(fname)
|
||||
if strings.Contains(basename, "..") {
|
||||
if strings.HasPrefix(basename, "..") {
|
||||
err = fmt.Errorf("basename cannot contain '..': '%s'", basename)
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue