ical.net icon indicating copy to clipboard operation
ical.net copied to clipboard

Recurrence parser does not follow RFC 5545

Open Sharparam opened this issue 6 years ago • 2 comments

There is an issue when parsing an RRULE string that does not begin with "FREQ". The current parser extracts the first occurrence of "FREQ" and everything following it, meaning that any properties that occurred before the first "FREQ" are ignored.

This is not according to RFC 5545, which states that "The rule parts are not ordered in any particular sequence.".

The problem starts with this regex pattern:

https://github.com/rianjs/ical.net/blob/master/net-core/Ical.Net/Serialization/DataTypes/RecurrencePatternSerializer.cs#L196

Sharparam avatar Feb 22 '19 14:02 Sharparam

Do you have some ics text that demonstrates the bug?

rianjs avatar Feb 22 '19 15:02 rianjs

Any RRULE string where data comes before the FREQ property will have that data stripped.

image

In the first one where FREQ is first, COUNT is parsed correctly. In the second one where COUNT comes before FREQ, it is being ignored and set to the default value.

Sharparam avatar Feb 22 '19 15:02 Sharparam