diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2020-03-25 08:11:49 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-25 08:11:49 +0100 |
commit | 3427653676e7ef985778794df27a6fd5e2bdaa11 (patch) | |
tree | 0150b927fa22c0c0e2b45d4b130af6f8e998cb26 /apps/dav/lib/CalDAV | |
parent | b93e1e300e70bca18f7ba822f6d8dfa09bc86803 (diff) | |
parent | bd1f98cba37ceb6c0d07a1d5764ec4eb22f369ed (diff) | |
download | nextcloud-server-3427653676e7ef985778794df27a6fd5e2bdaa11.tar.gz nextcloud-server-3427653676e7ef985778794df27a6fd5e2bdaa11.zip |
Merge pull request #19986 from nextcloud/bugfix/19980/fix_uid_as_uri
RefreshWebcalService: randomly generate calendar-object uri
Diffstat (limited to 'apps/dav/lib/CalDAV')
-rw-r--r-- | apps/dav/lib/CalDAV/WebcalCaching/RefreshWebcalService.php | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/apps/dav/lib/CalDAV/WebcalCaching/RefreshWebcalService.php b/apps/dav/lib/CalDAV/WebcalCaching/RefreshWebcalService.php index beab0271d8f..a057e29eb2c 100644 --- a/apps/dav/lib/CalDAV/WebcalCaching/RefreshWebcalService.php +++ b/apps/dav/lib/CalDAV/WebcalCaching/RefreshWebcalService.php @@ -47,6 +47,7 @@ use Sabre\VObject\InvalidDataException; use Sabre\VObject\ParseException; use Sabre\VObject\Reader; use Sabre\VObject\Splitter\ICalendar; +use Sabre\VObject\UUIDUtil; use function count; class RefreshWebcalService { @@ -113,7 +114,6 @@ class RefreshWebcalService { while ($vObject = $splitter->getNext()) { /** @var Component $vObject */ - $uid = null; $compName = null; foreach ($vObject->getComponents() as $component) { @@ -121,7 +121,6 @@ class RefreshWebcalService { continue; } - $uid = $component->{'UID'}->getValue(); $compName = $component->name; if ($stripAlarms) { @@ -136,7 +135,7 @@ class RefreshWebcalService { continue; } - $uri = $uid . '.ics'; + $uri = $this->getRandomCalendarObjectUri(); $calendarData = $vObject->serialize(); try { $this->calDavBackend->createCalendarObject($subscription['id'], $uri, $calendarData, CalDavBackend::CALENDAR_TYPE_SUBSCRIPTION); @@ -413,4 +412,13 @@ class RefreshWebcalService { return $cleanURL; } + + /** + * Returns a random uri for a calendar-object + * + * @return string + */ + public function getRandomCalendarObjectUri():string { + return UUIDUtil::getUUID() . '.ics'; + } } |