Skip to content

Commit 7fc115d

Browse files
Merge pull request #14101 from nextcloud/backport/14083/stable15
[stable15] Make sure the relative path is always a string
2 parents 8660fc3 + c295200 commit 7fc115d

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

apps/sharebymail/lib/ShareByMailProvider.php

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ protected function createShareActivity(IShare $share, string $type = 'share') {
254254
[$userFolder->getRelativePath($share->getNode()->getPath()), $share->getSharedWith()],
255255
$share->getSharedBy(),
256256
$share->getNode()->getId(),
257-
$userFolder->getRelativePath($share->getNode()->getPath())
257+
(string) $userFolder->getRelativePath($share->getNode()->getPath())
258258
);
259259

260260
if ($share->getShareOwner() !== $share->getSharedBy()) {
@@ -264,11 +264,10 @@ protected function createShareActivity(IShare $share, string $type = 'share') {
264264
$ownerPath = $nodes[0]->getPath();
265265
$this->publishActivity(
266266
$type === 'share' ? Activity::SUBJECT_SHARED_EMAIL_BY : Activity::SUBJECT_UNSHARED_EMAIL_BY,
267-
Activity::SUBJECT_SHARED_EMAIL_BY,
268267
[$ownerFolder->getRelativePath($ownerPath), $share->getSharedWith(), $share->getSharedBy()],
269268
$share->getShareOwner(),
270269
$fileId,
271-
$ownerFolder->getRelativePath($ownerPath)
270+
(string) $ownerFolder->getRelativePath($ownerPath)
272271
);
273272
}
274273

@@ -291,15 +290,15 @@ protected function createPasswordSendActivity(IShare $share, $sharedWith, $sendT
291290
[$userFolder->getRelativePath($share->getNode()->getPath())],
292291
$share->getSharedBy(),
293292
$share->getNode()->getId(),
294-
$userFolder->getRelativePath($share->getNode()->getPath())
293+
(string) $userFolder->getRelativePath($share->getNode()->getPath())
295294
);
296295
} else {
297296
$this->publishActivity(
298297
Activity::SUBJECT_SHARED_EMAIL_PASSWORD_SEND,
299298
[$userFolder->getRelativePath($share->getNode()->getPath()), $sharedWith],
300299
$share->getSharedBy(),
301300
$share->getNode()->getId(),
302-
$userFolder->getRelativePath($share->getNode()->getPath())
301+
(string) $userFolder->getRelativePath($share->getNode()->getPath())
303302
);
304303
}
305304
}
@@ -308,13 +307,13 @@ protected function createPasswordSendActivity(IShare $share, $sharedWith, $sendT
308307
/**
309308
* publish activity if a file/folder was shared by mail
310309
*
311-
* @param $subject
312-
* @param $parameters
313-
* @param $affectedUser
314-
* @param $fileId
315-
* @param $filePath
310+
* @param string $subject
311+
* @param array $parameters
312+
* @param string $affectedUser
313+
* @param int $fileId
314+
* @param string $filePath
316315
*/
317-
protected function publishActivity($subject, $parameters, $affectedUser, $fileId, $filePath) {
316+
protected function publishActivity(string $subject, array $parameters, string $affectedUser, int $fileId, string $filePath) {
318317
$event = $this->activityManager->generateEvent();
319318
$event->setApp('sharebymail')
320319
->setType('shared')

0 commit comments

Comments
 (0)