summaryrefslogtreecommitdiff
path: root/src/configreader.cpp
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2017-09-11 15:22:40 +0100
committerPeter Powell <petpow@saberuk.com>2017-09-18 14:09:01 +0100
commit60d92db9a1b71bbfd4230c5eb9f04cd6a87a41d8 (patch)
treef9f938d98e9e81920446b357f86a4a558bea4567 /src/configreader.cpp
parent21f2f56e98625fe640f8045737335d8ebdf879b7 (diff)
Add ModeParser::IsModeChar to standardise mode validation.
Diffstat (limited to 'src/configreader.cpp')
-rw-r--r--src/configreader.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/configreader.cpp b/src/configreader.cpp
index cc478b9b6..005730dca 100644
--- a/src/configreader.cpp
+++ b/src/configreader.cpp
@@ -487,8 +487,8 @@ void ServerConfig::Fill()
std::string modes = ConfValue("disabled")->getString("usermodes");
for (std::string::const_iterator p = modes.begin(); p != modes.end(); ++p)
{
- // Complain when the character is not a-z or A-Z
- if ((*p < 'A') || (*p > 'z') || ((*p < 'a') && (*p > 'Z')))
+ // Complain when the character is not a valid mode character.
+ if (!ModeParser::IsModeChar(*p))
throw CoreException("Invalid usermode " + std::string(1, *p) + " was found.");
DisabledUModes[*p - 'A'] = 1;
}
@@ -497,7 +497,7 @@ void ServerConfig::Fill()
modes = ConfValue("disabled")->getString("chanmodes");
for (std::string::const_iterator p = modes.begin(); p != modes.end(); ++p)
{
- if ((*p < 'A') || (*p > 'z') || ((*p < 'a') && (*p > 'Z')))
+ if (!ModeParser::IsModeChar(*p))
throw CoreException("Invalid chanmode " + std::string(1, *p) + " was found.");
DisabledCModes[*p - 'A'] = 1;
}