[Devel] Reject RRULE with INTERVAL=0 to Prevent Scheduler Hang (#16464)

* added interval null rrule check and updated tests

* Added secondly to the expected errors
This commit is contained in:
Stevenson Michel
2026-06-02 10:22:36 -04:00
committed by GitHub
parent c4c2779976
commit b14b9e1771
2 changed files with 7 additions and 1 deletions

View File

@@ -5450,7 +5450,11 @@ class SchedulePreviewSerializer(BaseSerializer):
for a_rule in match_multiple_rrule:
if 'interval' not in a_rule.lower():
errors.append("{0}: {1}".format(_('INTERVAL required in rrule'), a_rule))
elif 'secondly' in a_rule.lower():
else:
match_interval = re.match(r".*?INTERVAL=([0-9]+)", a_rule)
if match_interval and int(match_interval.group(1)) < 1:
errors.append("{0}: {1}".format(_("INTERVAL must be a positive integer"), a_rule))
if 'secondly' in a_rule.lower():
errors.append("{0}: {1}".format(_('SECONDLY is not supported'), a_rule))
if re.match(by_day_with_numeric_prefix, a_rule):
errors.append("{0}: {1}".format(_("BYDAY with numeric prefix not supported"), a_rule))