mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 02:00:11 -08:00
Assorted fixes
* Fix #679 (borked reply to `JOIN #chan,\r\n`) * Replace invalid error parameters with *'s in various places * Fix PART with no message sending an empty trailing parameter to the channel * Fix some error responses not getting labeled
This commit is contained in:
parent
fec1139dc8
commit
aa8579b6e8
5 changed files with 95 additions and 59 deletions
|
|
@ -54,3 +54,12 @@ func StringToBool(str string) (result bool, err error) {
|
|||
}
|
||||
return
|
||||
}
|
||||
|
||||
// Checks that a parameter can be passed as a non-trailing, and returns "*"
|
||||
// if it can't. See #697.
|
||||
func SafeErrorParam(param string) string {
|
||||
if param == "" || param[0] == ':' || strings.IndexByte(param, ' ') != -1 {
|
||||
return "*"
|
||||
}
|
||||
return param
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue