mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-11 06:29:29 +01:00
Merge pull request #1571 from slingamn/validation
validate that passphrases are valid as non-final IRC parameters
This commit is contained in:
commit
143e6ba9e3
@ -479,7 +479,11 @@ func validatePassphrase(passphrase string) error {
|
||||
if passphrase == "*" {
|
||||
return errAccountBadPassphrase
|
||||
}
|
||||
// for now, just enforce that spaces are not allowed
|
||||
// validate that the passphrase contains no spaces, and furthermore is valid as a
|
||||
// non-final IRC parameter. we already checked that it is nonempty:
|
||||
if passphrase[0] == ':' {
|
||||
return errAccountBadPassphrase
|
||||
}
|
||||
for _, r := range passphrase {
|
||||
if unicode.IsSpace(r) {
|
||||
return errAccountBadPassphrase
|
||||
|
Loading…
Reference in New Issue
Block a user