diff options
author | Robby <robby@chatbelgie.be> | 2018-11-21 01:32:41 +0100 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2018-11-21 00:48:30 +0000 |
commit | 05413dcaf3c4723e0e78d4a99d30c98cef241ea2 (patch) | |
tree | e158e4b308d6f9f1d1388261fa75bf5e273fac2e /src | |
parent | 4c6d7a12ab58b55ef49fb1cf62b57c6ef7daad5d (diff) |
m_blockcolor: Check for colors the same way InspIRCd::StripColor() does.
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/m_blockcolor.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/modules/m_blockcolor.cpp b/src/modules/m_blockcolor.cpp index 43d0826dd..273d1204e 100644 --- a/src/modules/m_blockcolor.cpp +++ b/src/modules/m_blockcolor.cpp @@ -55,17 +55,11 @@ class ModuleBlockColor : public Module { for (std::string::iterator i = details.text.begin(); i != details.text.end(); i++) { - switch (*i) + // Block all control codes except \001 for CTCP + if ((*i >= 0) && (*i < 32) && (*i != 1)) { - case 2: - case 3: - case 15: - case 21: - case 22: - case 31: - user->WriteNumeric(ERR_CANNOTSENDTOCHAN, c->name, "Can't send colors to channel (+c set)"); - return MOD_RES_DENY; - break; + user->WriteNumeric(ERR_CANNOTSENDTOCHAN, c->name, "Can't send colors to channel (+c set)"); + return MOD_RES_DENY; } } } |