mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-10 22:19:31 +01:00
restrict nicknames to proper character set
This commit is contained in:
parent
6f00f89efa
commit
9aeb813cf5
@ -17,13 +17,13 @@ var (
|
||||
ErrAlreadyDestroyed = errors.New("already destroyed")
|
||||
|
||||
// regexps
|
||||
ChannelNameExpr = regexp.MustCompile(`^[&!#+][[:word:]]{1,63}$`)
|
||||
ChannelNameExpr = regexp.MustCompile(`^[&!#+][\pL\pN]{1,63}$`)
|
||||
NicknameExpr = regexp.MustCompile(
|
||||
"^[[:alpha:]\\[\\]{}^`][[:word:]\\[\\]{}^`]{1,31}$")
|
||||
"^[\\pL\\[\\]{}^`][\\pL\\pN\\[\\]{}^`]{1,31}$")
|
||||
)
|
||||
|
||||
const (
|
||||
SEM_VER = "ergonomadic-1.2.6"
|
||||
SEM_VER = "ergonomadic-1.2.7"
|
||||
CRLF = "\r\n"
|
||||
MAX_REPLY_LEN = 512 - len(CRLF)
|
||||
|
||||
|
@ -407,6 +407,11 @@ func (msg *NickCommand) HandleServer(server *Server) {
|
||||
return
|
||||
}
|
||||
|
||||
if !IsNickname(msg.nickname) {
|
||||
client.ErrErroneusNickname(msg.nickname)
|
||||
return
|
||||
}
|
||||
|
||||
if msg.nickname == client.nick {
|
||||
return
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user