From 9b33684d60a9870c387405b6e7457bf2c0d9519d Mon Sep 17 00:00:00 2001 From: Ryan Cavicchioni Date: Sun, 4 Sep 2022 08:51:01 -0500 Subject: [PATCH] HasCommand() should detect an invalid command when it has arguments --- lib/common.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/common.go b/lib/common.go index 6c9d824..eddda01 100644 --- a/lib/common.go +++ b/lib/common.go @@ -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