From b353b799a2288bfde132a1909f78f4e1cbd1fd28 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Fri, 13 Jan 2023 07:17:32 +0000 Subject: Fix core_dns rejecting simple hostnames. --- include/inspircd.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/inspircd.h b/include/inspircd.h index edba04d24..3ad291909 100644 --- a/include/inspircd.h +++ b/include/inspircd.h @@ -390,9 +390,16 @@ class CoreExport InspIRCd /** Determines whether a hostname is valid according to RFC 5891 rules. * @param host The hostname to validate. + * @param allowsimple Whether to allow simple hostnames (e.g. localhost). * @return True if the hostname is valid; otherwise, false. */ - static bool IsHost(const std::string& host); + static bool IsHost2(const std::string& host, bool allowsimple); + + /** Determines whether a hostname is valid according to RFC 5891 rules. + * @param host The hostname to validate. + * @return True if the hostname is valid; otherwise, false. + */ + inline static bool IsHost(const std::string& host) { return IsHost2(host, false); } /** Return true if str looks like a server ID * @param sid string to check against -- cgit v1.3.1-10-gc9f91