mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 02:00:11 -08:00
validate normalized masks as IRC params
This commit is contained in:
parent
9670d96282
commit
af2b433195
2 changed files with 12 additions and 2 deletions
|
|
@ -15,6 +15,8 @@ import (
|
|||
"golang.org/x/text/secure/precis"
|
||||
"golang.org/x/text/unicode/norm"
|
||||
"golang.org/x/text/width"
|
||||
|
||||
"github.com/oragono/oragono/irc/utils"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
@ -270,7 +272,11 @@ func CanonicalizeMaskWildcard(userhost string) (expanded string, err error) {
|
|||
if host != "*" {
|
||||
host = strings.ToLower(host)
|
||||
}
|
||||
return fmt.Sprintf("%s!%s@%s", nick, user, host), nil
|
||||
expanded = fmt.Sprintf("%s!%s@%s", nick, user, host)
|
||||
if utils.SafeErrorParam(expanded) != expanded {
|
||||
err = errInvalidCharacter
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func foldASCII(str string) (result string, err error) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue