Merge pull request #1458 from tomwardill/ignore-rrule-errors

Ignore RRULE errors for unparseable elements.
This commit is contained in:
Michael Teeuw 2018-11-08 08:56:50 +01:00 committed by GitHub
commit 75054fcc70
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 2 deletions

View File

@ -22,6 +22,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Fixed
- Allow to parse recurring calendar events where the start date is before 1900
- Fixed Polish translation for Single Update Info
- Ignore entries with unparseable details in the calendar module
### Updated
- The default calendar setting `showEnd` is changed to `false`.

View File

@ -171,7 +171,7 @@ var CalendarFetcher = function(url, reloadInterval, excludedEvents, maximumEntri
var geo = event.geo || false;
var description = event.description || false;
if (typeof event.rrule != "undefined" && !isFacebookBirthday) {
if (typeof event.rrule != "undefined" && event.rrule != null && !isFacebookBirthday) {
var rule = event.rrule;
// can cause problems with e.g. birthdays before 1900

View File

@ -44,7 +44,13 @@ ical.objectHandlers['END'] = function(val, params, curr, stack){
rule += ' EXDATE:' + curr.exdates[i].toISOString().replace(/[-:]/g, '');
rule = rule.replace(/\.[0-9]{3}/, '');
}
curr.rrule = rrulestr(rule);
try {
curr.rrule = rrulestr(rule);
}
catch(err) {
console.log("Unrecognised element in calendar feed, ignoring: " + rule);
curr.rrule = null;
}
}
return originalEnd.call(this, val, params, curr, stack);
}