Improve user nick validation
This commit is contained in:
@ -5,6 +5,7 @@ import (
|
||||
"regexp"
|
||||
"strings"
|
||||
"time"
|
||||
"unicode/utf8"
|
||||
|
||||
"github.com/animenotifier/notify.moe/arn/autocorrect"
|
||||
)
|
||||
@ -31,6 +32,10 @@ func Nick(nick string) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
if !utf8.ValidString(nick) {
|
||||
return false
|
||||
}
|
||||
|
||||
return nick == autocorrect.UserNick(nick)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user