diff options
| author | 2023-01-13 07:44:32 +0000 | |
|---|---|---|
| committer | 2023-01-13 07:46:47 +0000 | |
| commit | 713b57749674beb77f1bedbec984776ad4d5a8ca (patch) | |
| tree | df7315487d8c8f36855d24f8cf2cf01510e9b870 /include | |
| parent | Add a new cloak system that cloaks using HMAC-SHA256. (diff) | |
| parent | Fix core_dns rejecting simple hostnames. (diff) | |
Merge branch 'insp3' into master.
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 38de778de..80db54b01 100644 --- a/include/inspircd.h +++ b/include/inspircd.h @@ -327,9 +327,16 @@ public: /** 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 IsHost(const std::string& host, bool allowsimple); + + /** Determines whether a fully qualified 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 IsFQDN(const std::string& host) { return IsHost(host, false); } /** Return true if str looks like a server ID * @param sid string to check against |
