3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-12-22 10:42:52 +01:00

Merge pull request #1571 from slingamn/validation

validate that passphrases are valid as non-final IRC parameters
This commit is contained in:
Shivaram Lingamneni 2021-03-01 17:09:51 -05:00 committed by GitHub
commit 143e6ba9e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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