]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Fix exempting CTCP ACTIONs in m_blockcaps and m_noctcp.
authorPeter Powell <petpow@saberuk.com>
Fri, 16 Jun 2017 17:08:40 +0000 (18:08 +0100)
committerPeter Powell <petpow@saberuk.com>
Fri, 16 Jun 2017 17:20:34 +0000 (18:20 +0100)
Previously we assumed that CTCP ACTIONs matched "\1ACTION ". This
is incorrect because "\1ACTION\1" and "\1ACTION" are valid CTCPs.

src/modules/m_blockcaps.cpp
src/modules/m_noctcp.cpp

index 2006936992aa333723efa750548e38acd964030a..7146ee068d421b0cf83525117eaad13355cd7b09 100644 (file)
@@ -67,7 +67,7 @@ public:
        {
                if (target_type == TYPE_CHANNEL)
                {
-                       if ((!IS_LOCAL(user)) || (text.length() < minlen))
+                       if ((!IS_LOCAL(user)) || (text.length() < minlen) || (text == "\1ACTION\1") || (text == "\1ACTION"))
                                return MOD_RES_PASSTHRU;
 
                        Channel* c = (Channel*)dest;
index 1dd6fe34ad467d71617f55b52316685cc9b3e9b7..c934a05c6edbfbe254d17b28f27d8c84d7a1fb5d 100644 (file)
@@ -67,7 +67,7 @@ class ModuleNoCTCP : public Module
                if ((target_type == TYPE_CHANNEL) && (IS_LOCAL(user)))
                {
                        Channel* c = (Channel*)dest;
-                       if ((text.empty()) || (text[0] != '\001') || (!strncmp(text.c_str(),"\1ACTION ",8)))
+                       if ((text.empty()) || (text[0] != '\001') || (!strncmp(text.c_str(),"\1ACTION ", 8)) || (text == "\1ACTION\1") || (text == "\1ACTION"))
                                return MOD_RES_PASSTHRU;
 
                        ModResult res = ServerInstance->OnCheckExemption(user,c,"noctcp");