fix: disallow * in member names, it breaks routing
This commit is contained in:
parent
65b171696a
commit
97391c51d8
|
@ -41,12 +41,14 @@ const (
|
||||||
)
|
)
|
||||||
|
|
||||||
// member names must match this regex
|
// 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.
|
// List of member names that cannot be used because they would break routing or be inaccessible due to page conflicts.
|
||||||
var invalidMemberNames = []string{
|
var invalidMemberNames = []string{
|
||||||
|
// these break routing outright
|
||||||
".",
|
".",
|
||||||
"..",
|
"..",
|
||||||
|
// the user edit page lives at `/@{username}/edit`, so a member named "edit" would be inaccessible
|
||||||
"edit",
|
"edit",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue