From 05413dcaf3c4723e0e78d4a99d30c98cef241ea2 Mon Sep 17 00:00:00 2001 From: Robby Date: Wed, 21 Nov 2018 01:32:41 +0100 Subject: m_blockcolor: Check for colors the same way InspIRCd::StripColor() does. --- src/modules/m_blockcolor.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'src/modules') 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; } } } -- cgit v1.3.1-10-gc9f91