Browse Source
Remove leading slash from sharing activity
Signed-off-by: Joas Schilling <coding@schilljs.com>
pull/2695/head
Joas Schilling
9 years ago
No known key found for this signature in database
GPG Key ID: E166FD8976B3BAC8
9 changed files with
13 additions and
11 deletions
-
apps/comments/lib/Activity/Provider.php
-
apps/files/lib/Activity/FavoriteProvider.php
-
apps/files/lib/Activity/Provider.php
-
apps/files_sharing/lib/Activity/Providers/Downloads.php
-
apps/files_sharing/lib/Activity/Providers/Groups.php
-
apps/files_sharing/lib/Activity/Providers/PublicLinks.php
-
apps/files_sharing/lib/Activity/Providers/Users.php
-
apps/sharebymail/lib/Activity.php
-
lib/public/RichObjectStrings/Definitions.php
|
|
|
@ -206,7 +206,7 @@ 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]), |
|
|
|
]; |
|
|
|
} |
|
|
|
|
|
|
|
@ -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]); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -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]), |
|
|
|
]; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -187,7 +187,7 @@ class Downloads implements IProvider { |
|
|
|
'type' => 'file', |
|
|
|
'id' => $id, |
|
|
|
'name' => basename($path), |
|
|
|
'path' => $path, |
|
|
|
'path' => trim($path, '/'), |
|
|
|
'link' => $this->url->linkToRouteAbsolute('files.viewcontroller.showFile', ['fileid' => $id]), |
|
|
|
]; |
|
|
|
} |
|
|
|
|
|
|
|
@ -232,7 +232,7 @@ class Groups implements IProvider { |
|
|
|
'type' => 'file', |
|
|
|
'id' => $id, |
|
|
|
'name' => basename($path), |
|
|
|
'path' => $path, |
|
|
|
'path' => trim($path, '/'), |
|
|
|
'link' => $this->url->linkToRouteAbsolute('files.viewcontroller.showFile', ['fileid' => $id]), |
|
|
|
]; |
|
|
|
} |
|
|
|
|
|
|
|
@ -239,7 +239,7 @@ class PublicLinks implements IProvider { |
|
|
|
'type' => 'file', |
|
|
|
'id' => $id, |
|
|
|
'name' => basename($path), |
|
|
|
'path' => $path, |
|
|
|
'path' => trim($path, '/'), |
|
|
|
'link' => $this->url->linkToRouteAbsolute('files.viewcontroller.showFile', ['fileid' => $id]), |
|
|
|
]; |
|
|
|
} |
|
|
|
|
|
|
|
@ -260,7 +260,7 @@ class Users implements IProvider { |
|
|
|
'type' => 'file', |
|
|
|
'id' => $id, |
|
|
|
'name' => basename($path), |
|
|
|
'path' => $path, |
|
|
|
'path' => trim($path, '/'), |
|
|
|
'link' => $this->url->linkToRouteAbsolute('files.viewcontroller.showFile', ['fileid' => $id]), |
|
|
|
]; |
|
|
|
} |
|
|
|
|
|
|
|
@ -196,7 +196,7 @@ class Activity implements IProvider { |
|
|
|
'type' => 'file', |
|
|
|
'id' => $id, |
|
|
|
'name' => basename($path), |
|
|
|
'path' => $path, |
|
|
|
'path' => trim($path, '/'), |
|
|
|
'link' => $this->url->linkToRouteAbsolute('files.viewcontroller.showFile', ['fileid' => $id]), |
|
|
|
]; |
|
|
|
} |
|
|
|
|
|
|
|
@ -191,7 +191,7 @@ class Definitions { |
|
|
|
'path' => [ |
|
|
|
'since' => '11.0.0', |
|
|
|
'required' => true, |
|
|
|
'description' => 'The full path of the file for the user', |
|
|
|
'description' => 'The full path of the file for the user, should not start with a slash', |
|
|
|
'example' => 'path/to/file.txt', |
|
|
|
], |
|
|
|
'link' => [ |
|
|
|
|