From 0a3666227220d66647fe1de7cd17db0c5f27f0de Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Fri, 29 Nov 2024 08:33:28 +0100 Subject: [PATCH] Fix PHP warning when fixing unavailabilities --- application/libraries/Caldav_sync.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/application/libraries/Caldav_sync.php b/application/libraries/Caldav_sync.php index 2e038b2c..309abeb3 100644 --- a/application/libraries/Caldav_sync.php +++ b/application/libraries/Caldav_sync.php @@ -104,9 +104,8 @@ class Caldav_sync public function save_unavailability(array $unavailability, array $provider): ?string { try { - // If the unavailability is reccuring don't sync - if (strpos($unavailability['id_caldav_calendar'], 'RECURRENCE') !== false) { - return $unavailability['id_caldav_calendar']; + if (str_contains((string) $unavailability['id_caldav_calendar'], 'RECURRENCE')) { + return $unavailability['id_caldav_calendar'] ?? null; // Do not sync recurring unavailabilities } $ics_file = $this->get_unavailability_ics_file($unavailability, $provider);