diff options
author | Sadie Powell <sadie@witchery.services> | 2024-05-18 18:36:17 +0100 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2024-05-18 18:36:17 +0100 |
commit | 729aa4ab4ae0a99deb072f01628015deb19ca7a0 (patch) | |
tree | 9d1d0920aab877444e5f3a360f6e055975015a6c | |
parent | 18e9e12261fa97aa47daf7d0fb729afd366aa5d6 (diff) |
Fix parsing the flood mode on UnrealIRCd.
-rw-r--r-- | modules/protocol/unrealircd.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/modules/protocol/unrealircd.cpp b/modules/protocol/unrealircd.cpp index ceb2ecd85..edae22a0a 100644 --- a/modules/protocol/unrealircd.cpp +++ b/modules/protocol/unrealircd.cpp @@ -675,24 +675,18 @@ public: /* Borrowed part of this check from UnrealIRCd */ bool IsValid(Anope::string &value) const override { - if (value.empty() || value[0] == ':') + if (value.empty() || value[0] != '[') return false; - Anope::string rest; - auto num1 = Anope::Convert<unsigned>(value[0] == '*' ? value.substr(1) : value, 0, &rest); - if (!num1 || rest[0] != ':' || rest.length() <= 1) - return false; - - if (Anope::Convert<int>(rest.substr(1), 0, &rest) > 0 && rest.empty()) - return true; - /* '['<number><1 letter>[optional: '#'+1 letter],[next..]']'':'<number> */ size_t end_bracket = value.find(']', 1); if (end_bracket == Anope::string::npos) return false; + Anope::string xbuf = value.substr(0, end_bracket); if (value[end_bracket + 1] != ':') return false; + commasepstream args(xbuf.substr(1)); Anope::string arg; while (args.GetToken(arg)) |