From f15a9749f9afc23e32e029ac495a53d24ac281b8 Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 12 Aug 2013 14:36:49 -0400 Subject: Use less strict valid ident checks on hybrid, unreal, and inspircd --- modules/protocol/unreal.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'modules/protocol/unreal.cpp') diff --git a/modules/protocol/unreal.cpp b/modules/protocol/unreal.cpp index 2da4af3e8..8e86ad729 100644 --- a/modules/protocol/unreal.cpp +++ b/modules/protocol/unreal.cpp @@ -376,6 +376,27 @@ class UnrealIRCdProto : public IRCDProto bi->Join(c); } } + + bool IsIdentValid(const Anope::string &ident) anope_override + { + if (ident.empty() || ident.length() > Config->GetBlock("networkinfo")->Get("userlen")) + return false; + + for (unsigned i = 0; i < ident.length(); ++i) + { + const char &c = ident[i]; + + if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9') || c == '.' || c == '-') + continue; + + if (c == '-' || c == '.' || c == '_') + continue; + + return false; + } + + return true; + } }; class UnrealExtBan : public ChannelModeList -- cgit