HasCommand() should detect an invalid command when it has arguments

This commit is contained in:
Ryan Cavicchioni 2022-09-04 08:51:01 -05:00
parent cd46fcb60d
commit 9b33684d60
Signed by: ryanc
GPG Key ID: 877EEDAF9245103D

View File

@ -53,6 +53,9 @@ func BuildURI(rawuri, rawpath string) string {
func HasCommand(s, prefix, cmd string) bool {
s = strings.TrimSpace(s)
args := strings.Split(s, " ")
s = args[0]
// a command cannot be less than two characters e.g. !x
if len(s) < 2 {
return false