Skip to content

Commit 72a4c65

Browse files
author
epriestley
committed
Fix some libphutil Calendar document bugs
Summary: Ref T10747. - Default to UTC if a datetime has no explicit timezone. - Fix a bug with escape detection that could incorrectly trigger for escaped commas. - Remove some unused properties (now properites of the RRULE itself). Test Plan: See next diff. Reviewers: chad Reviewed By: chad Maniphest Tasks: T10747 Differential Revision: https://secure.phabricator.com/D16698
1 parent 50cd143 commit 72a4c65

File tree

3 files changed

+2
-19
lines changed

3 files changed

+2
-19
lines changed

src/parser/calendar/data/PhutilCalendarDateTime.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function getISO8601() {
4848

4949
public function newAbsoluteDateTime() {
5050
$epoch = $this->getEpoch();
51-
$timezone = $this->getTimezone();
51+
$timezone = nonempty($this->getTimezone(), 'UTC');
5252
return PhutilCalendarAbsoluteDateTime::newFromEpoch($epoch, $timezone)
5353
->setIsAllDay($this->getIsAllDay())
5454
->setViewerTimezone($this->getViewerTimezone());

src/parser/calendar/data/PhutilCalendarEventNode.php

-18
Original file line numberDiff line numberDiff line change
@@ -139,24 +139,6 @@ public function getRecurrenceRule() {
139139
return $this->recurrenceRule;
140140
}
141141

142-
public function setRecurrenceUntilDateTime(PhutilCalendarDateTime $date) {
143-
$this->recurrenceUntilDateTime = $date;
144-
return $this;
145-
}
146-
147-
public function getRecurrenceUntilDateTime() {
148-
return $this->recurrenceUntilDateTime;
149-
}
150-
151-
public function setRecurrenceCount($recurrence_count) {
152-
$this->recurrenceCount = $recurrence_count;
153-
return $this;
154-
}
155-
156-
public function getRecurrenceCount() {
157-
return $this->recurrenceCount;
158-
}
159-
160142
public function setRecurrenceExceptions(array $recurrence_exceptions) {
161143
assert_instances_of($recurrence_exceptions, 'PhutilCalendarDateTime');
162144
$this->recurrenceExceptions = $recurrence_exceptions;

src/parser/calendar/ics/PhutilICSParser.php

+1
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,7 @@ private function unescapeTextValue($data) {
572572
$buf .= $c;
573573
break;
574574
}
575+
$esc = false;
575576
}
576577
}
577578

0 commit comments

Comments
 (0)