diff --git a/apps/dav/lib/CalDAV/Activity/Provider/Calendar.php b/apps/dav/lib/CalDAV/Activity/Provider/Calendar.php index 6082e68dcd2a8..36d425ecf63aa 100644 --- a/apps/dav/lib/CalDAV/Activity/Provider/Calendar.php +++ b/apps/dav/lib/CalDAV/Activity/Provider/Calendar.php @@ -168,32 +168,32 @@ protected function getParameters(IEvent $event) { case self::SUBJECT_UNSHARE_USER . '_self': return [ 'actor' => $this->generateUserParameter($parameters[0]), - 'calendar' => $this->generateCalendarParameter($event->getObjectId(), $parameters[1]), + 'calendar' => $this->generateCalendarParameter((int)$event->getObjectId(), $parameters[1]), ]; case self::SUBJECT_SHARE_USER . '_you': case self::SUBJECT_UNSHARE_USER . '_you': return [ 'user' => $this->generateUserParameter($parameters[0]), - 'calendar' => $this->generateCalendarParameter($event->getObjectId(), $parameters[1]), + 'calendar' => $this->generateCalendarParameter((int)$event->getObjectId(), $parameters[1]), ]; case self::SUBJECT_SHARE_USER . '_by': case self::SUBJECT_UNSHARE_USER . '_by': return [ 'user' => $this->generateUserParameter($parameters[0]), - 'calendar' => $this->generateCalendarParameter($event->getObjectId(), $parameters[1]), + 'calendar' => $this->generateCalendarParameter((int)$event->getObjectId(), $parameters[1]), 'actor' => $this->generateUserParameter($parameters[2]), ]; case self::SUBJECT_SHARE_GROUP . '_you': case self::SUBJECT_UNSHARE_GROUP . '_you': return [ 'group' => $this->generateGroupParameter($parameters[0]), - 'calendar' => $this->generateCalendarParameter($event->getObjectId(), $parameters[1]), + 'calendar' => $this->generateCalendarParameter((int)$event->getObjectId(), $parameters[1]), ]; case self::SUBJECT_SHARE_GROUP . '_by': case self::SUBJECT_UNSHARE_GROUP . '_by': return [ 'group' => $this->generateGroupParameter($parameters[0]), - 'calendar' => $this->generateCalendarParameter($event->getObjectId(), $parameters[1]), + 'calendar' => $this->generateCalendarParameter((int)$event->getObjectId(), $parameters[1]), 'actor' => $this->generateUserParameter($parameters[2]), ]; } diff --git a/apps/dav/lib/CalDAV/Activity/Provider/Event.php b/apps/dav/lib/CalDAV/Activity/Provider/Event.php index b591eaa351c9a..2c2e3d01c28a7 100644 --- a/apps/dav/lib/CalDAV/Activity/Provider/Event.php +++ b/apps/dav/lib/CalDAV/Activity/Provider/Event.php @@ -124,14 +124,14 @@ protected function getParameters(IEvent $event) { case self::SUBJECT_OBJECT_UPDATE . '_event': return [ 'actor' => $this->generateUserParameter($parameters[0]), - 'calendar' => $this->generateCalendarParameter($event->getObjectId(), $parameters[1]), + 'calendar' => $this->generateCalendarParameter((int)$event->getObjectId(), $parameters[1]), 'event' => $this->generateObjectParameter($parameters[2]), ]; case self::SUBJECT_OBJECT_ADD . '_event_self': case self::SUBJECT_OBJECT_DELETE . '_event_self': case self::SUBJECT_OBJECT_UPDATE . '_event_self': return [ - 'calendar' => $this->generateCalendarParameter($event->getObjectId(), $parameters[1]), + 'calendar' => $this->generateCalendarParameter((int)$event->getObjectId(), $parameters[1]), 'event' => $this->generateObjectParameter($parameters[2]), ]; } diff --git a/apps/dav/lib/CalDAV/Activity/Provider/Todo.php b/apps/dav/lib/CalDAV/Activity/Provider/Todo.php index 0ad1d137455c1..a665caa0e6a61 100644 --- a/apps/dav/lib/CalDAV/Activity/Provider/Todo.php +++ b/apps/dav/lib/CalDAV/Activity/Provider/Todo.php @@ -95,7 +95,7 @@ protected function getParameters(IEvent $event) { case self::SUBJECT_OBJECT_UPDATE . '_todo_needs_action': return [ 'actor' => $this->generateUserParameter($parameters[0]), - 'calendar' => $this->generateCalendarParameter($event->getObjectId(), $parameters[1]), + 'calendar' => $this->generateCalendarParameter((int)$event->getObjectId(), $parameters[1]), 'todo' => $this->generateObjectParameter($parameters[2]), ]; case self::SUBJECT_OBJECT_ADD . '_todo_self': @@ -104,7 +104,7 @@ protected function getParameters(IEvent $event) { case self::SUBJECT_OBJECT_UPDATE . '_todo_completed_self': case self::SUBJECT_OBJECT_UPDATE . '_todo_needs_action_self': return [ - 'calendar' => $this->generateCalendarParameter($event->getObjectId(), $parameters[1]), + 'calendar' => $this->generateCalendarParameter((int)$event->getObjectId(), $parameters[1]), 'todo' => $this->generateObjectParameter($parameters[2]), ]; } diff --git a/apps/dav/lib/CalDAV/BirthdayService.php b/apps/dav/lib/CalDAV/BirthdayService.php index 702b74bf1b376..e11f922a63688 100644 --- a/apps/dav/lib/CalDAV/BirthdayService.php +++ b/apps/dav/lib/CalDAV/BirthdayService.php @@ -270,7 +270,7 @@ protected function getAllAffectedPrincipals($addressBookId) { * @param string $cardData * @param array $book * @param int $calendarId - * @param string $type + * @param string[] $type */ private function updateCalendar($cardUri, $cardData, $book, $calendarId, $type) { $objectUri = $book['uri'] . '-' . $cardUri . $type['postfix'] . '.ics'; diff --git a/apps/dav/lib/CalDAV/CalDavBackend.php b/apps/dav/lib/CalDAV/CalDavBackend.php index 1cf27a800252c..b85415e28fc6e 100644 --- a/apps/dav/lib/CalDAV/CalDavBackend.php +++ b/apps/dav/lib/CalDAV/CalDavBackend.php @@ -50,6 +50,7 @@ use Sabre\VObject\DateTimeParser; use Sabre\VObject\Reader; use Sabre\VObject\Recur\EventIterator; +use Sabre\Uri; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\EventDispatcher\GenericEvent; @@ -318,7 +319,7 @@ function getCalendarsForUser($principalUri) { } } - list(, $name) = URLUtil::splitPath($row['principaluri']); + list(, $name) = Uri\split($row['principaluri']); $uri = $row['uri'] . '_shared_by_' . $name; $row['displayname'] = $row['displayname'] . ' (' . $this->getUserDisplayName($name) . ')'; $components = []; @@ -432,7 +433,7 @@ public function getPublicCalendars() { ->execute(); while($row = $result->fetch()) { - list(, $name) = URLUtil::splitPath($row['principaluri']); + list(, $name) = Uri\split($row['principaluri']); $row['displayname'] = $row['displayname'] . "($name)"; $components = []; if ($row['components']) { @@ -498,7 +499,7 @@ public function getPublicCalendar($uri) { throw new NotFound('Node with name \'' . $uri . '\' could not be found'); } - list(, $name) = URLUtil::splitPath($row['principaluri']); + list(, $name) = Uri\split($row['principaluri']); $row['displayname'] = $row['displayname'] . ' ' . "($name)"; $components = []; if ($row['components']) { @@ -2104,7 +2105,7 @@ protected function getCalendarObjectId($calendarId, $uri) { private function convertPrincipal($principalUri, $toV2) { if ($this->principalBackend->getPrincipalPrefix() === 'principals') { - list(, $name) = URLUtil::splitPath($principalUri); + list(, $name) = Uri\split($principalUri); if ($toV2 === true) { return "principals/users/$name"; }