From c90791d8cd7530262980501d7bea2eef12f533ec Mon Sep 17 00:00:00 2001 From: Abhishek Pai Date: Sun, 29 Mar 2026 10:39:53 +0200 Subject: [PATCH 1/2] #1588: Allow negative linux epoch --- lib/CalDAV/Backend/PDO.php | 8 -------- 1 file changed, 8 deletions(-) diff --git a/lib/CalDAV/Backend/PDO.php b/lib/CalDAV/Backend/PDO.php index 2767896434..a460ff506f 100644 --- a/lib/CalDAV/Backend/PDO.php +++ b/lib/CalDAV/Backend/PDO.php @@ -674,14 +674,6 @@ protected function getDenormalizedData($calendarData) $lastOccurence = $end->getTimeStamp(); } } - - // Ensure Occurence values are positive - if ($firstOccurence < 0) { - $firstOccurence = 0; - } - if ($lastOccurence < 0) { - $lastOccurence = 0; - } } // Destroy circular references to PHP will GC the object. From 206f9cece9ef8a47dc14c5ccc52a84dfac9f6841 Mon Sep 17 00:00:00 2001 From: Abhishek Pai Date: Fri, 3 Apr 2026 10:52:19 +0200 Subject: [PATCH 2/2] #1588: First and last occurence must be consecutive --- lib/CalDAV/Backend/PDO.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/CalDAV/Backend/PDO.php b/lib/CalDAV/Backend/PDO.php index a460ff506f..fe445aeeb4 100644 --- a/lib/CalDAV/Backend/PDO.php +++ b/lib/CalDAV/Backend/PDO.php @@ -674,6 +674,12 @@ protected function getDenormalizedData($calendarData) $lastOccurence = $end->getTimeStamp(); } } + + // Ensure Occurence values are positive + if (date_diff($firstOccurence, $lastOccurence)->invert) { + throw new \Sabre\DAV\Exception('Calendar firstOccurence and lastOccurence must be consecutive'); + } + } // Destroy circular references to PHP will GC the object.