diff options
-rw-r--r-- | docs/conf/modules.conf.example | 4 | ||||
-rw-r--r-- | include/inspircd.h | 2 | ||||
-rw-r--r-- | src/helperfuncs.cpp | 3 |
3 files changed, 5 insertions, 4 deletions
diff --git a/docs/conf/modules.conf.example b/docs/conf/modules.conf.example index dddd6b91f..aef45106c 100644 --- a/docs/conf/modules.conf.example +++ b/docs/conf/modules.conf.example @@ -1863,8 +1863,8 @@ # http://wiki.inspircd.org/Modules/ssl_openssl # #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# -# Strip color module: Adds channel mode +S that strips mIRC color -# codes from all messages sent to the channel. +# Strip color module: Adds channel mode +S that strips color codes and +# all control codes except CTCP from all messages sent to the channel. #<module name="stripcolor"> #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# diff --git a/include/inspircd.h b/include/inspircd.h index d41d2919b..91b70fbd8 100644 --- a/include/inspircd.h +++ b/include/inspircd.h @@ -546,7 +546,7 @@ class CoreExport InspIRCd */ static bool IsValidMask(const std::string& mask); - /** Strips all color codes from the given string + /** Strips all color and control codes except 001 from the given string * @param sentence The string to strip from */ static void StripColor(std::string &sentence); diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp index 78d272b5f..6217eb20b 100644 --- a/src/helperfuncs.cpp +++ b/src/helperfuncs.cpp @@ -127,7 +127,8 @@ void InspIRCd::StripColor(std::string &sentence) else seq = 0; - if (seq || ((*i == 2) || (*i == 15) || (*i == 22) || (*i == 21) || (*i == 31))) + // Strip all control codes too except \001 for CTCP + if (seq || ((*i < 32) && (*i != 1))) i = sentence.erase(i); else ++i; |