]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_chanhistory.cpp
Improve the handling of config X-lines and filters. (#1583)
[user/henk/code/inspircd.git] / src / modules / m_chanhistory.cpp
index 08f4291c916c73b452a484a342a69b219c7d2e76..1057e63b63338fcdb8aa48aabe98e279f17e3fb9 100644 (file)
@@ -71,9 +71,9 @@ class HistoryMode : public ParamMode<HistoryMode, SimpleExtItem<HistoryList> >
                        return MODEACTION_DENY;
                }
 
-               unsigned int len = ConvToInt(parameter.substr(0, colon));
-               unsigned int time = InspIRCd::Duration(duration);
-               if (len == 0 || (len > maxlines && IS_LOCAL(source)))
+               unsigned int len = ConvToNum<unsigned int>(parameter.substr(0, colon));
+               unsigned long time;
+               if (!InspIRCd::Duration(duration, time) || len == 0 || (len > maxlines && IS_LOCAL(source)))
                {
                        source->WriteNumeric(Numerics::InvalidModeParameter(channel, this, parameter));
                        return MODEACTION_DENY;