mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-10 02:59:01 -04:00
Strip all control codes except \001 in InspIRCd::StripColor()
Fixes issue #1100 reported by @uecasm
This commit is contained in:
parent
306ef5e3ea
commit
5b5590f095
@ -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">
|
||||
|
||||
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user