3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-11 06:29:29 +01:00

Merge pull request #1633 from slingamn/register_400

fix FAIL REGISTER INVALID_USERNAME case
This commit is contained in:
Shivaram Lingamneni 2021-04-25 20:43:15 -04:00 committed by GitHub
commit 973d7dc1dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2528,8 +2528,9 @@ func registerHandler(server *Server, client *Client, msg ircmsg.Message, rb *Res
}
// check that accountName is valid as a non-final parameter;
// this is necessary for us to be valid and it will prevent us from emitting invalid error lines
if accountName == "*" || accountName != utils.SafeErrorParam(accountName) {
rb.Add(nil, server.name, "FAIL", "REGISTER", "INVALID_USERNAME", accountName, client.t("Username invalid or not given"))
nickErrorParam := utils.SafeErrorParam(accountName)
if accountName == "*" || accountName != nickErrorParam {
rb.Add(nil, server.name, "FAIL", "REGISTER", "INVALID_USERNAME", nickErrorParam, client.t("Username invalid or not given"))
return
}