fix: disallow * in member names, it breaks routing

This commit is contained in:
sam 2023-10-28 00:58:20 +02:00
parent 65b171696a
commit 97391c51d8
No known key found for this signature in database
GPG Key ID: B4EF20DDE721CAA1
1 changed files with 3 additions and 1 deletions

View File

@ -41,12 +41,14 @@ const (
)
// member names must match this regex
var memberNameRegex = regexp.MustCompile("^[^@\\?!#/\\\\[\\]\"\\{\\}'$%&()+<=>^|~`,]{1,100}$")
var memberNameRegex = regexp.MustCompile("^[^@\\?!#/\\\\[\\]\"\\{\\}'$%&()+<=>^|~`,\\*]{1,100}$")
// List of member names that cannot be used because they would break routing or be inaccessible due to page conflicts.
var invalidMemberNames = []string{
// these break routing outright
".",
"..",
// the user edit page lives at `/@{username}/edit`, so a member named "edit" would be inaccessible
"edit",
}