aboutsummaryrefslogtreecommitdiffstats
path: root/src/helperfuncs.cpp
diff options
context:
space:
mode:
authorGravatar Attila Molnar2015-12-08 16:32:50 +0100
committerGravatar Attila Molnar2015-12-08 16:32:50 +0100
commit5b5590f09599c3fca1fd2c2ed9a6908cdd201597 (patch)
treebb80df76e84795c77f71eb433774f5af49787a0d /src/helperfuncs.cpp
parentDeduplicate code in InspIRCd::FindNick() (diff)
Strip all control codes except \001 in InspIRCd::StripColor()
Fixes issue #1100 reported by @uecasm
Diffstat (limited to 'src/helperfuncs.cpp')
-rw-r--r--src/helperfuncs.cpp3
1 files changed, 2 insertions, 1 deletions
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;