1
0
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:
Sadie Powell
2025-07-12 14:41:09 +01:00
parent 6873630f2e
commit ce7bb15c18
+4 -11
View File
@@ -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;
}
}