Fix PHP warning when fixing unavailabilities

This commit is contained in:
Alex Tselegidis 2024-11-29 08:33:28 +01:00
parent 3d6e3d8e1c
commit 0a36662272

View file

@ -104,9 +104,8 @@ class Caldav_sync
public function save_unavailability(array $unavailability, array $provider): ?string public function save_unavailability(array $unavailability, array $provider): ?string
{ {
try { try {
// If the unavailability is reccuring don't sync if (str_contains((string) $unavailability['id_caldav_calendar'], 'RECURRENCE')) {
if (strpos($unavailability['id_caldav_calendar'], 'RECURRENCE') !== false) { return $unavailability['id_caldav_calendar'] ?? null; // Do not sync recurring unavailabilities
return $unavailability['id_caldav_calendar'];
} }
$ics_file = $this->get_unavailability_ics_file($unavailability, $provider); $ics_file = $this->get_unavailability_ics_file($unavailability, $provider);