summaryrefslogtreecommitdiffstats
path: root/apps/dav/lib
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2017-07-20 09:36:18 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2017-08-01 08:20:16 +0200
commitf57a3aa81b27cdc7fbf4595deca9022384aacc91 (patch)
tree17623a4f86049334baeaa1cf10e4a6d392030d08 /apps/dav/lib
parent201bbb962c982ca9aa5d1aed52fef2c587055ea3 (diff)
downloadnextcloud-server-f57a3aa81b27cdc7fbf4595deca9022384aacc91.tar.gz
nextcloud-server-f57a3aa81b27cdc7fbf4595deca9022384aacc91.zip
[DAV][CalDAV] Fixes
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/dav/lib')
-rw-r--r--apps/dav/lib/CalDAV/Activity/Provider/Calendar.php10
-rw-r--r--apps/dav/lib/CalDAV/Activity/Provider/Event.php4
-rw-r--r--apps/dav/lib/CalDAV/Activity/Provider/Todo.php4
-rw-r--r--apps/dav/lib/CalDAV/BirthdayService.php2
-rw-r--r--apps/dav/lib/CalDAV/CalDavBackend.php9
5 files changed, 15 insertions, 14 deletions
diff --git a/apps/dav/lib/CalDAV/Activity/Provider/Calendar.php b/apps/dav/lib/CalDAV/Activity/Provider/Calendar.php
index 6082e68dcd2..36d425ecf63 100644
--- a/apps/dav/lib/CalDAV/Activity/Provider/Calendar.php
+++ b/apps/dav/lib/CalDAV/Activity/Provider/Calendar.php
@@ -168,32 +168,32 @@ class Calendar extends Base {
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 b591eaa351c..2c2e3d01c28 100644
--- a/apps/dav/lib/CalDAV/Activity/Provider/Event.php
+++ b/apps/dav/lib/CalDAV/Activity/Provider/Event.php
@@ -124,14 +124,14 @@ class Event extends Base {
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 0ad1d137455..a665caa0e6a 100644
--- a/apps/dav/lib/CalDAV/Activity/Provider/Todo.php
+++ b/apps/dav/lib/CalDAV/Activity/Provider/Todo.php
@@ -95,7 +95,7 @@ class Todo extends 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 @@ class Todo extends 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 702b74bf1b3..e11f922a636 100644
--- a/apps/dav/lib/CalDAV/BirthdayService.php
+++ b/apps/dav/lib/CalDAV/BirthdayService.php
@@ -270,7 +270,7 @@ class BirthdayService {
* @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 1cf27a80025..b85415e28fc 100644
--- a/apps/dav/lib/CalDAV/CalDavBackend.php
+++ b/apps/dav/lib/CalDAV/CalDavBackend.php
@@ -50,6 +50,7 @@ use Sabre\VObject\Component\VCalendar;
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 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
}
}
- 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 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
->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 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
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 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
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";
}