Be more strict about 12 months limit (#185)

This commit is contained in:
Dmitrii Metelkin 2018-08-06 10:42:09 +10:00 committed by Mark Nelson
parent 36ec9188fa
commit 0eb96e3605

View file

@ -281,7 +281,7 @@ class element extends \mod_customcert\element {
}
// Check that recurring dateranges are not longer than 12 months.
if (!empty($data[$recurring]) && $rangeperiod > self::MAX_RECURRING_PERIOD ) {
if (!empty($data[$recurring]) && $rangeperiod >= self::MAX_RECURRING_PERIOD ) {
$errors[$this->build_element_name('enddate', $i)] = get_string('error:recurring', 'customcertelement_daterange');
}
}