From 4fcbf27bdfbd38e9f61730773869d1bcb28f2169 Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Wed, 29 Dec 2021 12:51:39 +0100 Subject: [PATCH 1/2] Make all CalDAV PHP classes strict Signed-off-by: Christoph Wurst --- apps/dav/lib/CalDAV/Activity/Backend.php | 3 +++ apps/dav/lib/CalDAV/Activity/Filter/Calendar.php | 3 +++ apps/dav/lib/CalDAV/Activity/Filter/Todo.php | 3 +++ apps/dav/lib/CalDAV/Activity/Provider/Base.php | 3 +++ apps/dav/lib/CalDAV/Activity/Provider/Calendar.php | 3 +++ apps/dav/lib/CalDAV/Activity/Provider/Event.php | 3 +++ apps/dav/lib/CalDAV/Activity/Provider/Todo.php | 3 +++ apps/dav/lib/CalDAV/Activity/Setting/Calendar.php | 3 +++ apps/dav/lib/CalDAV/Activity/Setting/Event.php | 3 +++ apps/dav/lib/CalDAV/Activity/Setting/Todo.php | 3 +++ apps/dav/lib/CalDAV/BirthdayCalendar/EnablePlugin.php | 3 +++ apps/dav/lib/CalDAV/CalDavBackend.php | 3 +++ apps/dav/lib/CalDAV/Calendar.php | 3 +++ apps/dav/lib/CalDAV/CalendarHome.php | 3 +++ apps/dav/lib/CalDAV/CalendarManager.php | 3 +++ apps/dav/lib/CalDAV/CalendarObject.php | 3 +++ apps/dav/lib/CalDAV/CalendarRoot.php | 3 +++ apps/dav/lib/CalDAV/ICSExportPlugin/ICSExportPlugin.php | 3 +++ apps/dav/lib/CalDAV/Integration/ExternalCalendar.php | 3 +++ apps/dav/lib/CalDAV/Integration/ICalendarProvider.php | 3 +++ .../lib/CalDAV/InvitationResponse/InvitationResponseServer.php | 3 +++ apps/dav/lib/CalDAV/Outbox.php | 3 +++ apps/dav/lib/CalDAV/Plugin.php | 3 +++ apps/dav/lib/CalDAV/Principal/Collection.php | 3 +++ apps/dav/lib/CalDAV/Principal/User.php | 3 +++ apps/dav/lib/CalDAV/PublicCalendar.php | 3 +++ apps/dav/lib/CalDAV/PublicCalendarObject.php | 3 +++ apps/dav/lib/CalDAV/PublicCalendarRoot.php | 3 +++ apps/dav/lib/CalDAV/Publishing/PublishPlugin.php | 3 +++ apps/dav/lib/CalDAV/Publishing/Xml/Publisher.php | 3 +++ .../lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php | 3 +++ .../lib/CalDAV/ResourceBooking/ResourcePrincipalBackend.php | 3 +++ apps/dav/lib/CalDAV/ResourceBooking/RoomPrincipalBackend.php | 3 +++ apps/dav/lib/CalDAV/Schedule/IMipPlugin.php | 3 +++ apps/dav/lib/CalDAV/Schedule/Plugin.php | 3 +++ apps/dav/lib/CalDAV/Search/SearchPlugin.php | 3 +++ apps/dav/lib/CalDAV/Search/Xml/Filter/CompFilter.php | 3 +++ apps/dav/lib/CalDAV/Search/Xml/Filter/LimitFilter.php | 3 +++ apps/dav/lib/CalDAV/Search/Xml/Filter/OffsetFilter.php | 3 +++ apps/dav/lib/CalDAV/Search/Xml/Filter/ParamFilter.php | 3 +++ apps/dav/lib/CalDAV/Search/Xml/Filter/PropFilter.php | 3 +++ apps/dav/lib/CalDAV/Search/Xml/Filter/SearchTermFilter.php | 3 +++ .../dav/lib/CalDAV/Search/Xml/Request/CalendarSearchReport.php | 3 +++ 43 files changed, 129 insertions(+) diff --git a/apps/dav/lib/CalDAV/Activity/Backend.php b/apps/dav/lib/CalDAV/Activity/Backend.php index 84ba50b8c37b6..a18bfa54c9b99 100644 --- a/apps/dav/lib/CalDAV/Activity/Backend.php +++ b/apps/dav/lib/CalDAV/Activity/Backend.php @@ -1,4 +1,7 @@ * diff --git a/apps/dav/lib/CalDAV/Activity/Filter/Calendar.php b/apps/dav/lib/CalDAV/Activity/Filter/Calendar.php index 06258e3cf746b..2b3802d63d69c 100644 --- a/apps/dav/lib/CalDAV/Activity/Filter/Calendar.php +++ b/apps/dav/lib/CalDAV/Activity/Filter/Calendar.php @@ -1,4 +1,7 @@ * diff --git a/apps/dav/lib/CalDAV/Activity/Filter/Todo.php b/apps/dav/lib/CalDAV/Activity/Filter/Todo.php index f727c10befe9f..4f6b731f8ce7a 100644 --- a/apps/dav/lib/CalDAV/Activity/Filter/Todo.php +++ b/apps/dav/lib/CalDAV/Activity/Filter/Todo.php @@ -1,4 +1,7 @@ * diff --git a/apps/dav/lib/CalDAV/Activity/Provider/Base.php b/apps/dav/lib/CalDAV/Activity/Provider/Base.php index 7f70980a72b9f..4a3af5fe88d38 100644 --- a/apps/dav/lib/CalDAV/Activity/Provider/Base.php +++ b/apps/dav/lib/CalDAV/Activity/Provider/Base.php @@ -1,4 +1,7 @@ * diff --git a/apps/dav/lib/CalDAV/Activity/Provider/Calendar.php b/apps/dav/lib/CalDAV/Activity/Provider/Calendar.php index daab7806e4678..a4d61e83e8903 100644 --- a/apps/dav/lib/CalDAV/Activity/Provider/Calendar.php +++ b/apps/dav/lib/CalDAV/Activity/Provider/Calendar.php @@ -1,4 +1,7 @@ * diff --git a/apps/dav/lib/CalDAV/Activity/Provider/Event.php b/apps/dav/lib/CalDAV/Activity/Provider/Event.php index 96366f5494292..45864d00e848f 100644 --- a/apps/dav/lib/CalDAV/Activity/Provider/Event.php +++ b/apps/dav/lib/CalDAV/Activity/Provider/Event.php @@ -1,4 +1,7 @@ * diff --git a/apps/dav/lib/CalDAV/Activity/Provider/Todo.php b/apps/dav/lib/CalDAV/Activity/Provider/Todo.php index a3ab81e38ae38..6c64126b4e9e2 100644 --- a/apps/dav/lib/CalDAV/Activity/Provider/Todo.php +++ b/apps/dav/lib/CalDAV/Activity/Provider/Todo.php @@ -1,4 +1,7 @@ * diff --git a/apps/dav/lib/CalDAV/Activity/Setting/Calendar.php b/apps/dav/lib/CalDAV/Activity/Setting/Calendar.php index 4a226fca43971..07cd30938e174 100644 --- a/apps/dav/lib/CalDAV/Activity/Setting/Calendar.php +++ b/apps/dav/lib/CalDAV/Activity/Setting/Calendar.php @@ -1,4 +1,7 @@ * diff --git a/apps/dav/lib/CalDAV/Activity/Setting/Event.php b/apps/dav/lib/CalDAV/Activity/Setting/Event.php index 0239296a403b5..174cc1598acb1 100644 --- a/apps/dav/lib/CalDAV/Activity/Setting/Event.php +++ b/apps/dav/lib/CalDAV/Activity/Setting/Event.php @@ -1,4 +1,7 @@ * diff --git a/apps/dav/lib/CalDAV/Activity/Setting/Todo.php b/apps/dav/lib/CalDAV/Activity/Setting/Todo.php index 7d27b30c4afc0..b9b0f10a875a8 100644 --- a/apps/dav/lib/CalDAV/Activity/Setting/Todo.php +++ b/apps/dav/lib/CalDAV/Activity/Setting/Todo.php @@ -1,4 +1,7 @@ * diff --git a/apps/dav/lib/CalDAV/BirthdayCalendar/EnablePlugin.php b/apps/dav/lib/CalDAV/BirthdayCalendar/EnablePlugin.php index b736d9432bd14..2e8c55b2f1845 100644 --- a/apps/dav/lib/CalDAV/BirthdayCalendar/EnablePlugin.php +++ b/apps/dav/lib/CalDAV/BirthdayCalendar/EnablePlugin.php @@ -1,4 +1,7 @@ * diff --git a/apps/dav/lib/CalDAV/CalDavBackend.php b/apps/dav/lib/CalDAV/CalDavBackend.php index fa6e6a7ecbb4d..212dec9dfbd7f 100644 --- a/apps/dav/lib/CalDAV/CalDavBackend.php +++ b/apps/dav/lib/CalDAV/CalDavBackend.php @@ -1,4 +1,7 @@ * diff --git a/apps/dav/lib/CalDAV/CalendarObject.php b/apps/dav/lib/CalDAV/CalendarObject.php index 1582e8f2bfc98..a39aff0ef1183 100644 --- a/apps/dav/lib/CalDAV/CalendarObject.php +++ b/apps/dav/lib/CalDAV/CalendarObject.php @@ -1,4 +1,7 @@ * diff --git a/apps/dav/lib/CalDAV/Integration/ExternalCalendar.php b/apps/dav/lib/CalDAV/Integration/ExternalCalendar.php index 9c801a08a260d..eed67c2818a6e 100644 --- a/apps/dav/lib/CalDAV/Integration/ExternalCalendar.php +++ b/apps/dav/lib/CalDAV/Integration/ExternalCalendar.php @@ -1,4 +1,7 @@ * diff --git a/apps/dav/lib/CalDAV/Integration/ICalendarProvider.php b/apps/dav/lib/CalDAV/Integration/ICalendarProvider.php index c72112f06ba14..471a569a1be3c 100644 --- a/apps/dav/lib/CalDAV/Integration/ICalendarProvider.php +++ b/apps/dav/lib/CalDAV/Integration/ICalendarProvider.php @@ -1,4 +1,7 @@ * diff --git a/apps/dav/lib/CalDAV/InvitationResponse/InvitationResponseServer.php b/apps/dav/lib/CalDAV/InvitationResponse/InvitationResponseServer.php index af3d7c1269a93..c4cefbfe1c8a6 100644 --- a/apps/dav/lib/CalDAV/InvitationResponse/InvitationResponseServer.php +++ b/apps/dav/lib/CalDAV/InvitationResponse/InvitationResponseServer.php @@ -1,4 +1,7 @@ * diff --git a/apps/dav/lib/CalDAV/Principal/User.php b/apps/dav/lib/CalDAV/Principal/User.php index 904ecc32e893c..573388348f45b 100644 --- a/apps/dav/lib/CalDAV/Principal/User.php +++ b/apps/dav/lib/CalDAV/Principal/User.php @@ -1,4 +1,7 @@ * diff --git a/apps/dav/lib/CalDAV/PublicCalendar.php b/apps/dav/lib/CalDAV/PublicCalendar.php index 4a29c8d237afa..694142cf0fffd 100644 --- a/apps/dav/lib/CalDAV/PublicCalendar.php +++ b/apps/dav/lib/CalDAV/PublicCalendar.php @@ -1,4 +1,7 @@ * diff --git a/apps/dav/lib/CalDAV/Publishing/Xml/Publisher.php b/apps/dav/lib/CalDAV/Publishing/Xml/Publisher.php index 35bce872bf818..10e06ed933c1a 100644 --- a/apps/dav/lib/CalDAV/Publishing/Xml/Publisher.php +++ b/apps/dav/lib/CalDAV/Publishing/Xml/Publisher.php @@ -1,4 +1,7 @@ * diff --git a/apps/dav/lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php b/apps/dav/lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php index aebb5a24f0e5d..b9ff3c461d4e2 100644 --- a/apps/dav/lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php +++ b/apps/dav/lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php @@ -1,4 +1,7 @@ * diff --git a/apps/dav/lib/CalDAV/ResourceBooking/ResourcePrincipalBackend.php b/apps/dav/lib/CalDAV/ResourceBooking/ResourcePrincipalBackend.php index 65203e24da591..ecd2e6ab31c3e 100644 --- a/apps/dav/lib/CalDAV/ResourceBooking/ResourcePrincipalBackend.php +++ b/apps/dav/lib/CalDAV/ResourceBooking/ResourcePrincipalBackend.php @@ -1,4 +1,7 @@ * diff --git a/apps/dav/lib/CalDAV/ResourceBooking/RoomPrincipalBackend.php b/apps/dav/lib/CalDAV/ResourceBooking/RoomPrincipalBackend.php index ca78ebd4bc432..6e7a39709bbb5 100644 --- a/apps/dav/lib/CalDAV/ResourceBooking/RoomPrincipalBackend.php +++ b/apps/dav/lib/CalDAV/ResourceBooking/RoomPrincipalBackend.php @@ -1,4 +1,7 @@ * diff --git a/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php b/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php index 8aacc33bb46a4..d987a90196910 100644 --- a/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php +++ b/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php @@ -1,4 +1,7 @@ * @copyright Copyright (c) 2016, Joas Schilling diff --git a/apps/dav/lib/CalDAV/Search/SearchPlugin.php b/apps/dav/lib/CalDAV/Search/SearchPlugin.php index d08a5749ab20b..9cd7ee43caf4d 100644 --- a/apps/dav/lib/CalDAV/Search/SearchPlugin.php +++ b/apps/dav/lib/CalDAV/Search/SearchPlugin.php @@ -1,4 +1,7 @@ * diff --git a/apps/dav/lib/CalDAV/Search/Xml/Filter/CompFilter.php b/apps/dav/lib/CalDAV/Search/Xml/Filter/CompFilter.php index d5b7c834e3647..d7837db39ac84 100644 --- a/apps/dav/lib/CalDAV/Search/Xml/Filter/CompFilter.php +++ b/apps/dav/lib/CalDAV/Search/Xml/Filter/CompFilter.php @@ -1,4 +1,7 @@ * diff --git a/apps/dav/lib/CalDAV/Search/Xml/Filter/LimitFilter.php b/apps/dav/lib/CalDAV/Search/Xml/Filter/LimitFilter.php index 2c435ba3650ac..9ca12b1392439 100644 --- a/apps/dav/lib/CalDAV/Search/Xml/Filter/LimitFilter.php +++ b/apps/dav/lib/CalDAV/Search/Xml/Filter/LimitFilter.php @@ -1,4 +1,7 @@ * diff --git a/apps/dav/lib/CalDAV/Search/Xml/Filter/OffsetFilter.php b/apps/dav/lib/CalDAV/Search/Xml/Filter/OffsetFilter.php index a6f41d091617a..e1ce2b67f231b 100644 --- a/apps/dav/lib/CalDAV/Search/Xml/Filter/OffsetFilter.php +++ b/apps/dav/lib/CalDAV/Search/Xml/Filter/OffsetFilter.php @@ -1,4 +1,7 @@ * diff --git a/apps/dav/lib/CalDAV/Search/Xml/Filter/ParamFilter.php b/apps/dav/lib/CalDAV/Search/Xml/Filter/ParamFilter.php index c25450a0c9444..11242a5b8789a 100644 --- a/apps/dav/lib/CalDAV/Search/Xml/Filter/ParamFilter.php +++ b/apps/dav/lib/CalDAV/Search/Xml/Filter/ParamFilter.php @@ -1,4 +1,7 @@ * diff --git a/apps/dav/lib/CalDAV/Search/Xml/Filter/PropFilter.php b/apps/dav/lib/CalDAV/Search/Xml/Filter/PropFilter.php index 990b0ebf73087..e4f8f028de544 100644 --- a/apps/dav/lib/CalDAV/Search/Xml/Filter/PropFilter.php +++ b/apps/dav/lib/CalDAV/Search/Xml/Filter/PropFilter.php @@ -1,4 +1,7 @@ * diff --git a/apps/dav/lib/CalDAV/Search/Xml/Filter/SearchTermFilter.php b/apps/dav/lib/CalDAV/Search/Xml/Filter/SearchTermFilter.php index 06fe39a463bde..aa0ee7b68a83e 100644 --- a/apps/dav/lib/CalDAV/Search/Xml/Filter/SearchTermFilter.php +++ b/apps/dav/lib/CalDAV/Search/Xml/Filter/SearchTermFilter.php @@ -1,4 +1,7 @@ * diff --git a/apps/dav/lib/CalDAV/Search/Xml/Request/CalendarSearchReport.php b/apps/dav/lib/CalDAV/Search/Xml/Request/CalendarSearchReport.php index 98efe36ee43c6..1b917a0e2ebaa 100644 --- a/apps/dav/lib/CalDAV/Search/Xml/Request/CalendarSearchReport.php +++ b/apps/dav/lib/CalDAV/Search/Xml/Request/CalendarSearchReport.php @@ -1,4 +1,7 @@ * From 83ce6cf28383607b155fc39e073c1c55536681b8 Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Mon, 3 Jan 2022 13:53:50 +0100 Subject: [PATCH 2/2] Fix implicit Sabre parameter cast to string Ref https://github.com/sabre-io/vobject/pull/560 Signed-off-by: Christoph Wurst --- apps/dav/lib/CalDAV/CalDavBackend.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/dav/lib/CalDAV/CalDavBackend.php b/apps/dav/lib/CalDAV/CalDavBackend.php index 212dec9dfbd7f..d70e987572cea 100644 --- a/apps/dav/lib/CalDAV/CalDavBackend.php +++ b/apps/dav/lib/CalDAV/CalDavBackend.php @@ -93,6 +93,7 @@ use Sabre\VObject\Component\VTimeZone; use Sabre\VObject\DateTimeParser; use Sabre\VObject\InvalidDataException; +use Sabre\VObject\Parameter; use Sabre\VObject\ParseException; use Sabre\VObject\Property; use Sabre\VObject\Reader; @@ -3020,8 +3021,10 @@ public function updateProperties($calendarId, $objectUri, $calendarData, $calend $parameters = $property->parameters(); $indexedParametersForProperty = self::$indexParameters[$property->name]; - foreach ($parameters as $key => $value) { + foreach ($parameters as $key => $parameter) { + /** @var Parameter $parameter */ if (in_array($key, $indexedParametersForProperty)) { + $value = $parameter->getValue(); // is this a shitty db? if ($this->db->supports4ByteText()) { $value = preg_replace('/[\x{10000}-\x{10FFFF}]/u', "\xEF\xBF\xBD", $value);