diff options
-rw-r--r-- | src/configreader.cpp | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/src/configreader.cpp b/src/configreader.cpp index b5d6b3ecb..125bf595d 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -72,26 +72,6 @@ ServerConfig::~ServerConfig() delete EmptyTag; } -static void ValidHost(const std::string& p, const std::string& msg) -{ - int num_dots = 0; - if (p.empty() || p[0] == '.') - throw CoreException("The value of "+msg+" is not a valid hostname"); - for (unsigned int i=0;i < p.length();i++) - { - switch (p[i]) - { - case ' ': - throw CoreException("The value of "+msg+" is not a valid hostname"); - case '.': - num_dots++; - break; - } - } - if (num_dots == 0) - throw CoreException("The value of "+msg+" is not a valid hostname"); -} - bool ServerConfig::ApplyDisabledCommands() { // Enable everything first. @@ -389,8 +369,7 @@ void ServerConfig::Fill() ConfigTag* server = ConfValue("server"); if (sid.empty()) { - ServerName = server->getString("name", "irc.example.com"); - ValidHost(ServerName, "<server:name>"); + ServerName = server->getString("name", "irc.example.com", InspIRCd::IsHost); sid = server->getString("id"); if (!sid.empty() && !InspIRCd::IsSID(sid)) |