Skip to content

Commit

Permalink
Fix PHP warning when fixing unavailabilities
Browse files Browse the repository at this point in the history
  • Loading branch information
alextselegidis committed Nov 29, 2024
1 parent 3d6e3d8 commit 0a36662
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions application/libraries/Caldav_sync.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,8 @@ public function save_appointment(array $appointment, array $service, array $prov
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);
Expand Down

0 comments on commit 0a36662

Please sign in to comment.