summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2019-02-07 23:38:48 +0100
committerGitHub <noreply@github.com>2019-02-07 23:38:48 +0100
commit21671d5cb5cf85e47a6b8424b050909ceed45478 (patch)
tree00de97f2b82aecf08887dadd77d2a715bd48b977
parent612ca63e3d37c924b8a3c645f3fb24d162ed8439 (diff)
parentb93aa586f4636c3863745056ccf0f498fe61ab7f (diff)
downloadnextcloud-server-21671d5cb5cf85e47a6b8424b050909ceed45478.tar.gz
nextcloud-server-21671d5cb5cf85e47a6b8424b050909ceed45478.zip
Merge pull request #14083 from nextcloud/bugfix/noid/make-sure-the-path-is-always-a-string
Make sure the relative path is always a string
-rw-r--r--apps/sharebymail/lib/ShareByMailProvider.php21
1 files changed, 10 insertions, 11 deletions
diff --git a/apps/sharebymail/lib/ShareByMailProvider.php b/apps/sharebymail/lib/ShareByMailProvider.php
index e255adfd3f6..30b3dc79169 100644
--- a/apps/sharebymail/lib/ShareByMailProvider.php
+++ b/apps/sharebymail/lib/ShareByMailProvider.php
@@ -254,7 +254,7 @@ class ShareByMailProvider implements IShareProvider {
[$userFolder->getRelativePath($share->getNode()->getPath()), $share->getSharedWith()],
$share->getSharedBy(),
$share->getNode()->getId(),
- $userFolder->getRelativePath($share->getNode()->getPath())
+ (string) $userFolder->getRelativePath($share->getNode()->getPath())
);
if ($share->getShareOwner() !== $share->getSharedBy()) {
@@ -264,11 +264,10 @@ class ShareByMailProvider implements IShareProvider {
$ownerPath = $nodes[0]->getPath();
$this->publishActivity(
$type === 'share' ? Activity::SUBJECT_SHARED_EMAIL_BY : Activity::SUBJECT_UNSHARED_EMAIL_BY,
- Activity::SUBJECT_SHARED_EMAIL_BY,
[$ownerFolder->getRelativePath($ownerPath), $share->getSharedWith(), $share->getSharedBy()],
$share->getShareOwner(),
$fileId,
- $ownerFolder->getRelativePath($ownerPath)
+ (string) $ownerFolder->getRelativePath($ownerPath)
);
}
@@ -291,7 +290,7 @@ class ShareByMailProvider implements IShareProvider {
[$userFolder->getRelativePath($share->getNode()->getPath())],
$share->getSharedBy(),
$share->getNode()->getId(),
- $userFolder->getRelativePath($share->getNode()->getPath())
+ (string) $userFolder->getRelativePath($share->getNode()->getPath())
);
} else {
$this->publishActivity(
@@ -299,7 +298,7 @@ class ShareByMailProvider implements IShareProvider {
[$userFolder->getRelativePath($share->getNode()->getPath()), $sharedWith],
$share->getSharedBy(),
$share->getNode()->getId(),
- $userFolder->getRelativePath($share->getNode()->getPath())
+ (string) $userFolder->getRelativePath($share->getNode()->getPath())
);
}
}
@@ -308,13 +307,13 @@ class ShareByMailProvider implements IShareProvider {
/**
* publish activity if a file/folder was shared by mail
*
- * @param $subject
- * @param $parameters
- * @param $affectedUser
- * @param $fileId
- * @param $filePath
+ * @param string $subject
+ * @param array $parameters
+ * @param string $affectedUser
+ * @param int $fileId
+ * @param string $filePath
*/
- protected function publishActivity($subject, $parameters, $affectedUser, $fileId, $filePath) {
+ protected function publishActivity(string $subject, array $parameters, string $affectedUser, int $fileId, string $filePath) {
$event = $this->activityManager->generateEvent();
$event->setApp('sharebymail')
->setType('shared')