HasCommand() should detect an invalid command when it has arguments
This commit is contained in:
parent
cd46fcb60d
commit
9b33684d60
@ -53,6 +53,9 @@ func BuildURI(rawuri, rawpath string) string {
|
|||||||
func HasCommand(s, prefix, cmd string) bool {
|
func HasCommand(s, prefix, cmd string) bool {
|
||||||
s = strings.TrimSpace(s)
|
s = strings.TrimSpace(s)
|
||||||
|
|
||||||
|
args := strings.Split(s, " ")
|
||||||
|
s = args[0]
|
||||||
|
|
||||||
// a command cannot be less than two characters e.g. !x
|
// a command cannot be less than two characters e.g. !x
|
||||||
if len(s) < 2 {
|
if len(s) < 2 {
|
||||||
return false
|
return false
|
||||||
|
Loading…
Reference in New Issue
Block a user