From 4fdab5cd41a9d99919042ab97311fe0ea2f9de38 Mon Sep 17 00:00:00 2001
From: Peter Thienel <thienel@data-quest.de>
Date: Wed, 22 Mar 2023 10:16:52 +0000
Subject: [PATCH] Resolve "Keine Veranstaltungstermin im Kalender", fixes #2218

Closes #2218

Merge request studip/studip!1450
---
 lib/classes/calendar/SingleCalendar.php | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/lib/classes/calendar/SingleCalendar.php b/lib/classes/calendar/SingleCalendar.php
index bd968262c11..938db1a134a 100644
--- a/lib/classes/calendar/SingleCalendar.php
+++ b/lib/classes/calendar/SingleCalendar.php
@@ -1234,13 +1234,14 @@ class SingleCalendar
         $properties = $event->getProperties();
         if (is_array($restrictions)) {
             foreach ($restrictions as $property_name => $restriction) {
-                if (is_array($restriction) && isset($properties[mb_strtoupper($property_name)])) {
-                    return in_array($properties[mb_strtoupper($property_name)], $restriction);
-                } else if ($restriction != '') {
-                    return isset($properties[mb_strtoupper($property_name)]) && $properties[mb_strtoupper($property_name)] === $restriction;
+                if (isset($properties[mb_strtoupper($property_name)])) {
+                    if (is_array($restriction)) {
+                        return in_array($properties[mb_strtoupper($property_name)], $restriction);
+                    } else if ($restriction != '') {
+                        return $properties[mb_strtoupper($property_name)] == $restriction;
+                    }
                 }
             }
-            return true;
         }
         return true;
     }
-- 
GitLab