mirror of
https://github.com/anope/anope.git
synced 2026-07-01 17:06:38 +02:00
Use IsIdentValid for validating usernames in hs_request.
This commit is contained in:
@@ -77,11 +77,6 @@ struct HostRequestTypeImpl final
|
||||
class CommandHSRequest final
|
||||
: public Command
|
||||
{
|
||||
static bool isvalidchar(char c)
|
||||
{
|
||||
return (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9') || c == '.' || c == '-';
|
||||
}
|
||||
|
||||
public:
|
||||
CommandHSRequest(Module *creator) : Command(creator, "hostserv/request", 1, 1)
|
||||
{
|
||||
@@ -142,13 +137,11 @@ public:
|
||||
source.Reply(HOST_NO_VIDENT);
|
||||
return;
|
||||
}
|
||||
for (const auto &chr : user)
|
||||
|
||||
if (!IRCD->IsIdentValid(user))
|
||||
{
|
||||
if (!isvalidchar(chr))
|
||||
{
|
||||
source.Reply(HOST_SET_IDENT_ERROR);
|
||||
return;
|
||||
}
|
||||
source.Reply(HOST_SET_IDENT_ERROR);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user