diff options
author | Adam <Adam@anope.org> | 2012-11-25 22:37:54 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2012-11-25 22:37:54 -0500 |
commit | 1bdb756b258e2acce1db96584b540f452370e1a8 (patch) | |
tree | 7c4d048f987627cbec23c32d8bc961ed8278aba0 /modules/commands/cs_kick.cpp | |
parent | 80c573eed7c053f8bf5ef437eb948e821b8adc07 (diff) |
Restrict the length of kick reasons in cs_kick, cs_ban, and cs_akick
Diffstat (limited to 'modules/commands/cs_kick.cpp')
-rw-r--r-- | modules/commands/cs_kick.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/commands/cs_kick.cpp b/modules/commands/cs_kick.cpp index 4073f3fe8..e02ab5185 100644 --- a/modules/commands/cs_kick.cpp +++ b/modules/commands/cs_kick.cpp @@ -27,7 +27,7 @@ class CommandCSKick : public Command { const Anope::string &chan = params[0]; const Anope::string &target = params[1]; - const Anope::string &reason = params.size() > 2 ? params[2] : "Requested"; + Anope::string reason = params.size() > 2 ? params[2] : "Requested"; User *u = source.GetUser(); ChannelInfo *ci = ChannelInfo::Find(params[0]); @@ -45,6 +45,9 @@ class CommandCSKick : public Command return; } + if (reason.length() > Config->CSReasonMax) + reason = reason.substr(0, Config->CSReasonMax); + AccessGroup u_access = source.AccessFor(ci); if (!u_access.HasPriv("KICK")) |