Merge pull request #2695 from nextcloud/remove-leading-slashes-on-share-activity
Remove leading slash from sharing activity
This commit is contained in:
commit
6fd421cc3c
9 changed files with 13 additions and 11 deletions
|
@ -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' => [
|
||||
|
|
Loading…
Reference in a new issue