aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGravatar Sadie Powell2023-01-13 07:17:32 +0000
committerGravatar Sadie Powell2023-01-13 07:23:45 +0000
commitb353b799a2288bfde132a1909f78f4e1cbd1fd28 (patch)
treef0430248fa53e1edda368da86538ab068dd4e7ae /include
parentMake Dependabot send pull requests to the insp3 branch. (diff)
Fix core_dns rejecting simple hostnames.
Diffstat (limited to 'include')
-rw-r--r--include/inspircd.h9
1 files changed, 8 insertions, 1 deletions
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