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 fbe8024438
commit a7441e8b1b

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');
}
}