diff options
| author | 2023-01-13 07:17:32 +0000 | |
|---|---|---|
| committer | 2023-01-13 07:23:45 +0000 | |
| commit | b353b799a2288bfde132a1909f78f4e1cbd1fd28 (patch) | |
| tree | f0430248fa53e1edda368da86538ab068dd4e7ae /include | |
| parent | Make Dependabot send pull requests to the insp3 branch. (diff) | |
Fix core_dns rejecting simple hostnames.
Diffstat (limited to 'include')
| -rw-r--r-- | include/inspircd.h | 9 |
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 |
