summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2020-12-25 03:46:43 +0000
committerSadie Powell <sadie@witchery.services>2020-12-25 03:46:43 +0000
commitbf3bfec6d58f566b98eb09ba0bf83d6a46ca400f (patch)
tree59728877109547b1056f85b21c97e4aabd63c40b /src
parent71ad7b2cd22ace30dae3506a39858c804e7f1895 (diff)
Avoid doing more work than necessary when checking the O: extban.
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_operchans.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/modules/m_operchans.cpp b/src/modules/m_operchans.cpp
index 072595269..f133d85f7 100644
--- a/src/modules/m_operchans.cpp
+++ b/src/modules/m_operchans.cpp
@@ -66,15 +66,10 @@ class ModuleOperChans : public Module
if (!user->IsOper())
return MOD_RES_PASSTHRU;
- // Check whether the oper's type matches the ban.
- const std::string submask = mask.substr(2);
- if (InspIRCd::Match(user->oper->name, submask))
- return MOD_RES_DENY;
-
- // If the oper's type contains spaces recheck with underscores.
+ // Replace spaces with underscores as they're prohibited in mode parameters.
std::string opername(user->oper->name);
stdalgo::string::replace_all(opername, space, underscore);
- if (InspIRCd::Match(opername, submask))
+ if (InspIRCd::Match(opername, mask.substr(2)))
return MOD_RES_DENY;
return MOD_RES_PASSTHRU;