diff options
Diffstat (limited to 'modules/commands/cs_ban.cpp')
-rw-r--r-- | modules/commands/cs_ban.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/commands/cs_ban.cpp b/modules/commands/cs_ban.cpp index e857243f9..0fb65ecf6 100644 --- a/modules/commands/cs_ban.cpp +++ b/modules/commands/cs_ban.cpp @@ -27,7 +27,7 @@ class CommandCSBan : 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"; ChannelInfo *ci = ChannelInfo::Find(params[0]); if (ci == NULL) @@ -42,6 +42,9 @@ class CommandCSBan : public Command AccessGroup u_access = source.AccessFor(ci); + if (reason.length() > Config->CSReasonMax) + reason = reason.substr(0, Config->CSReasonMax); + if (!c) source.Reply(CHAN_X_NOT_IN_USE, chan.c_str()); else if (!u_access.HasPriv("BAN")) |