diff options
Diffstat (limited to 'src/configparser.cpp')
-rw-r--r-- | src/configparser.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/configparser.cpp b/src/configparser.cpp index 437b3cdb0..efcc6c68b 100644 --- a/src/configparser.cpp +++ b/src/configparser.cpp @@ -535,6 +535,13 @@ unsigned long ConfigTag::getDuration(const std::string& key, unsigned long def, if (!readString(key, duration)) return def; + if (!InspIRCd::IsValidDuration(duration)) + { + 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; |