Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14007038
D16729.id40282.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D16729.id40282.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Tue, Oct 29, 10:38 PM (1 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6717083
Default Alt Text
D16729.id40282.diff (2 KB)
Attached To
Mode
D16729: Fix some minor parsing bugs in ICS parser
Attached
Detach File
Event Timeline
Log In to Comment