productivity/baikal: add timezone workaround for recurrence expansion

As explained in [0], when creating a calendar via the web interface, Baikal
sets cal:calendar-timezone to a timezone string instead of a VTIMEZONE object.
This causes an issue when querying events with expanded recurrences, see [1].

To work around this, create a new DateTimeZone object from the string.

[0] https://github.com/sabre-io/Baikal/issues/1241
[1] https://github.com/sabre-io/Baikal/issues/1325
This commit is contained in:
jtt
2026-02-02 09:58:44 +00:00
parent 8abaf4b52d
commit 71d41dc3d2
2 changed files with 23 additions and 0 deletions
+1
View File
@@ -2,6 +2,7 @@ COMMENT= lightweight CalDAV and CardDAV server
VERSION= 0.11.1
DISTNAME= baikal-${VERSION}
REVISION= 0
SITES= https://github.com/sabre-io/Baikal/releases/download/${VERSION}/
DISTFILES= ${DISTNAME}.zip
CATEGORIES= productivity www
@@ -0,0 +1,22 @@
https://github.com/sabre-io/Baikal/issues/1241
https://github.com/sabre-io/Baikal/issues/1325
Index: vendor/sabre/dav/lib/CalDAV/Plugin.php
--- vendor/sabre/dav/lib/CalDAV/Plugin.php.orig
+++ vendor/sabre/dav/lib/CalDAV/Plugin.php
@@ -508,14 +508,7 @@ class Plugin extends DAV\ServerPlugin
$tzProp = '{'.self::NS_CALDAV.'}calendar-timezone';
$tzResult = $this->server->getProperties($path, [$tzProp]);
if (isset($tzResult[$tzProp])) {
- // This property contains a VCALENDAR with a single
- // VTIMEZONE.
- $vtimezoneObj = VObject\Reader::read($tzResult[$tzProp]);
- $calendarTimeZone = $vtimezoneObj->VTIMEZONE->getTimeZone();
-
- // Destroy circular references so PHP will garbage collect the
- // object.
- $vtimezoneObj->destroy();
+ $calendarTimeZone = new DateTimeZone($tzResult[$tzProp]);
} else {
// Defaulting to UTC.
$calendarTimeZone = new DateTimeZone('UTC');