fix(backend): disallow '.' and '..' in user and member names
This commit is contained in:
parent
0e9ac347c0
commit
4f43e32fdb
2 changed files with 28 additions and 11 deletions
|
@ -38,6 +38,11 @@ const (
|
|||
var memberNameRegex = regexp.MustCompile("^[^@\\?!#/\\\\[\\]\"\\{\\}'$%&()+<=>^|~`,]{1,100}$")
|
||||
|
||||
func MemberNameValid(name string) bool {
|
||||
// These two names will break routing, but periods should still be allowed in names otherwise.
|
||||
if name == "." || name == ".." {
|
||||
return false
|
||||
}
|
||||
|
||||
return memberNameRegex.MatchString(name)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue