aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/CalDAV
diff options
context:
space:
mode:
authorRichard Steinmetz <richard@steinmetz.cloud>2023-09-20 17:45:54 +0200
committerRichard Steinmetz <richard@steinmetz.cloud>2023-09-21 23:28:35 +0200
commitace08819f98b346b713b7ae2639582a7b9d0261e (patch)
tree54d3499b32511e208f27f2e6514eb816ab52501c /apps/dav/lib/CalDAV
parent3b6a9cd23628464cd24da3d426764a8232124f33 (diff)
downloadnextcloud-server-ace08819f98b346b713b7ae2639582a7b9d0261e.tar.gz
nextcloud-server-ace08819f98b346b713b7ae2639582a7b9d0261e.zip
fix(dav): expand recurrences when searching
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
Diffstat (limited to 'apps/dav/lib/CalDAV')
-rw-r--r--apps/dav/lib/CalDAV/CalDavBackend.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/apps/dav/lib/CalDAV/CalDavBackend.php b/apps/dav/lib/CalDAV/CalDavBackend.php
index 915976d7dd3..5f2fe7e5dce 100644
--- a/apps/dav/lib/CalDAV/CalDavBackend.php
+++ b/apps/dav/lib/CalDAV/CalDavBackend.php
@@ -20,6 +20,7 @@
* @author Thomas Citharel <nextcloud@tcit.fr>
* @author Thomas Müller <thomas.mueller@tmit.eu>
* @author Vinicius Cubas Brand <vinicius@eita.org.br>
+ * @author Richard Steinmetz <richard@steinmetz.cloud>
*
* @license AGPL-3.0
*
@@ -1959,8 +1960,18 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
});
$result->closeCursor();
- return array_map(function ($o) {
+ return array_map(function ($o) use ($options) {
$calendarData = Reader::read($o['calendardata']);
+
+ // Expand recurrences if an explicit time range is requested
+ if ($calendarData instanceof VCalendar
+ && isset($options['timerange']['start'], $options['timerange']['end'])) {
+ $calendarData = $calendarData->expand(
+ $options['timerange']['start'],
+ $options['timerange']['end'],
+ );
+ }
+
$comps = $calendarData->getComponents();
$objects = [];
$timezones = [];