Improve user nick validation

This commit is contained in:
2019-11-17 15:45:02 +09:00
parent 7b66778c84
commit 59e11fac4c
2 changed files with 6 additions and 0 deletions

View File

@ -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)
}