summaryrefslogtreecommitdiff
path: root/src/configparser.cpp
diff options
context:
space:
mode:
authorlinuxdaemon <linuxdaemon@users.noreply.github.com>2018-12-21 12:37:22 -0600
committerPeter Powell <petpow@saberuk.com>2018-12-21 19:37:22 +0100
commit7530285740c2db1bc4457859b0d5f2436e0ed113 (patch)
tree89635613725a1b7ad6e262d7e3035a518d42e8d2 /src/configparser.cpp
parent60ae49b62a371791ebbd9e4b131e33b857873f06 (diff)
Only parse valid durations, don't treat invalid multipliers as seconds (#1538)
Diffstat (limited to 'src/configparser.cpp')
-rw-r--r--src/configparser.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/configparser.cpp b/src/configparser.cpp
index e4bf4bd71..abdf6f3de 100644
--- a/src/configparser.cpp
+++ b/src/configparser.cpp
@@ -609,14 +609,14 @@ unsigned long ConfigTag::getDuration(const std::string& key, unsigned long def,
if (!readString(key, duration))
return def;
- if (!InspIRCd::IsValidDuration(duration))
+ unsigned long ret;
+ if (!InspIRCd::Duration(duration, ret))
{
ServerInstance->Logs->Log("CONFIG", LOG_DEFAULT, "Value of <" + tag + ":" + key + "> at " + getTagLocation() +
" is not a duration; value set to " + ConvToStr(def) + ".");
return def;
}
- unsigned long ret = InspIRCd::Duration(duration);
CheckRange(tag, key, ret, def, min, max);
return ret;
}