diff options
author | Joas Schilling <coding@schilljs.com> | 2016-12-15 15:53:48 +0100 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2016-12-15 15:53:48 +0100 |
commit | 6de0eb0b741ff1cf0b735480a6c2d2fbcb1e70ca (patch) | |
tree | 3f94de87c67d706be564bfd8b1cb56e2f7ed1505 /apps/files/lib | |
parent | 3714a6aaf0b565808bd1ec7f8552196447402f58 (diff) | |
download | nextcloud-server-6de0eb0b741ff1cf0b735480a6c2d2fbcb1e70ca.tar.gz nextcloud-server-6de0eb0b741ff1cf0b735480a6c2d2fbcb1e70ca.zip |
Remove leading slash from sharing activity
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/files/lib')
-rw-r--r-- | apps/files/lib/Activity/FavoriteProvider.php | 5 | ||||
-rw-r--r-- | apps/files/lib/Activity/Provider.php | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/apps/files/lib/Activity/FavoriteProvider.php b/apps/files/lib/Activity/FavoriteProvider.php index 8047eb1319e..ed00d50f221 100644 --- a/apps/files/lib/Activity/FavoriteProvider.php +++ b/apps/files/lib/Activity/FavoriteProvider.php @@ -142,10 +142,11 @@ class FavoriteProvider implements IProvider { 'type' => 'file', 'id' => $event->getObjectId(), 'name' => basename($event->getObjectName()), - 'path' => $event->getObjectName(), + 'path' => trim($event->getObjectName(), '/'), + 'link' => $this->url->linkToRouteAbsolute('files.viewcontroller.showFile', ['fileid' => $event->getObjectId()]), ]; - $event->setParsedSubject(str_replace('{file}', trim($parameter['path'], '/'), $subject)) + $event->setParsedSubject(str_replace('{file}', $parameter['path'], $subject)) ->setRichSubject($subject, ['file' => $parameter]); } } diff --git a/apps/files/lib/Activity/Provider.php b/apps/files/lib/Activity/Provider.php index 92686ec0c36..ae303034610 100644 --- a/apps/files/lib/Activity/Provider.php +++ b/apps/files/lib/Activity/Provider.php @@ -201,7 +201,7 @@ class Provider implements IProvider { foreach ($parameters as $placeholder => $parameter) { $placeholders[] = '{' . $placeholder . '}'; if ($parameter['type'] === 'file') { - $replacements[] = trim($parameter['path'], '/'); + $replacements[] = $parameter['path']; } else { $replacements[] = $parameter['name']; } @@ -253,7 +253,8 @@ class Provider implements IProvider { 'type' => 'file', 'id' => $id, 'name' => basename($path), - 'path' => $path, + 'path' => trim($path, '/'), + 'link' => $this->url->linkToRouteAbsolute('files.viewcontroller.showFile', ['fileid' => $id]), ]; } |