Page MenuHomePhabricator

D16729.diff
No OneTemporary

D16729.diff

diff --git a/src/parser/calendar/data/PhutilCalendarRecurrenceRule.php b/src/parser/calendar/data/PhutilCalendarRecurrenceRule.php
--- a/src/parser/calendar/data/PhutilCalendarRecurrenceRule.php
+++ b/src/parser/calendar/data/PhutilCalendarRecurrenceRule.php
@@ -170,6 +170,7 @@
'BYMINUTE',
'BYHOUR',
'BYDAY',
+ 'BYMONTH',
'BYMONTHDAY',
'BYYEARDAY',
'BYWEEKNO',
@@ -198,6 +199,7 @@
->setByMinute(idx($dict, 'BYMINUTE', array()))
->setByHour(idx($dict, 'BYHOUR', array()))
->setByDay(idx($dict, 'BYDAY', array()))
+ ->setByMonth(idx($dict, 'BYMONTH', array()))
->setByMonthDay(idx($dict, 'BYMONTHDAY', array()))
->setByYearDay(idx($dict, 'BYYEARDAY', array()))
->setByWeekNumber(idx($dict, 'BYWEEKNO', array()))
@@ -252,6 +254,36 @@
$dict[$key] = $value;
}
+ $int_lists = array_fuse(
+ array(
+ // NOTE: "BYDAY" is absent, and takes a list like "MO, TU, WE".
+ 'BYSECOND',
+ 'BYMINUTE',
+ 'BYHOUR',
+ 'BYMONTH',
+ 'BYMONTHDAY',
+ 'BYYEARDAY',
+ 'BYWEEKNO',
+ 'BYSETPOS',
+ ));
+
+ foreach ($dict as $key => $value) {
+ if (isset($int_lists[$key])) {
+ foreach ($value as $k => $v) {
+ if (!preg_match('/^-?\d+\z/', $v)) {
+ throw new Exception(
+ pht(
+ 'Unexpected value "%s" in "%s" RRULE property: expected '.
+ 'only integers.',
+ $v,
+ $key));
+ }
+ $value[$k] = (int)$v;
+ }
+ $dict[$key] = $value;
+ }
+ }
+
return self::newFromDictionary($dict);
}
diff --git a/src/parser/calendar/ics/PhutilICSParser.php b/src/parser/calendar/ics/PhutilICSParser.php
--- a/src/parser/calendar/ics/PhutilICSParser.php
+++ b/src/parser/calendar/ics/PhutilICSParser.php
@@ -660,6 +660,10 @@
$rrule = $this->newRecurrenceRuleFromProperty($parameters, $value);
$node->setRecurrenceRule($rrule);
break;
+ case 'RECURRENCE-ID':
+ $text = $this->newTextFromProperty($parameters, $value);
+ $node->setRecurrenceID($text);
+ break;
}
}

File Metadata

Mime Type
text/plain
Expires
Wed, Oct 16, 11:49 AM (3 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6717083
Default Alt Text
D16729.diff (2 KB)

Event Timeline